Questions tagged [mkdir]
The mkdir tag has no usage guidance.
156
questions
1
vote
2
answers
75
views
Can't create included directory [duplicate]
I'd like to create a new directory that looks like /dir1/dir2/dir3/dir4 but I can't.
If I create the directories one by one from the parent and new parent directories, everything works:
lm@debian:~$ ...
0
votes
0
answers
37
views
Why did this mkdir not work properly? [duplicate]
Why did this mkdir not work properly?
The folder is strangely named as {a.
mkdir -p myfile/{a/a{1..10}, b/b{10..30}, c/c{1,2,3}}
0
votes
1
answer
134
views
sudo mkdir /srv/www permission denied
I'm setting up a new webserver on Debian.
As my previous install had everything located in /srv/www I want to use the same setup to avoid rewriting a bunch of config files.
However executing mkdir /...
0
votes
0
answers
535
views
Inside Docker: mkdir(-p): No such file or directory
I have encountered a strange problem where the mkdir -p command fails to create a directory and returns the following error message:
[root@202 ~]# pwd
/root
[root@202 ~]# mkdir -p a/b/c
mkdir: cannot ...
-2
votes
1
answer
300
views
how to create a directory that already exists with another name
i want to create directory called "A" inside my home directory but i don't know if such a directory already exists. i want to write a command that creates the directory if it does not exist. ...
2
votes
1
answer
178
views
touch/mkdir seems to ignore default ACL
I am pretty sure it is a stupid mistake but I can't seem to figure it out by myself, so please have a look.
I set up an ACL for the current folder like so:
zigbee2mqtt@nuc:/tmp/folder$ getfacl .
# ...
0
votes
2
answers
352
views
move and make directory
I know its a big classical but I didn't found the exact situation that concerns me
I need a mkdir+mv command that can be invoked like that :
mvdir /home/user/Documents/irs.pdf /mnt/work/45/223/insight/...
0
votes
1
answer
109
views
replacing explicit user names with variables in mkdir and chown
What specific changes need to be made in the commands below in order to use a variable username and a variable user_home to create a subdirectory within the current user's home and then to change ...
0
votes
1
answer
18
views
/dev/sda4/ on USB stick isn't available after formatting. 'Discs' shows the following:
size: 58 GB
contents: unknown
device: /dev/sda4
partition type: basic data
When I ran the format, I selected the type which I expected result in type of Linux.
I found a similar issue from 2019, but ...
0
votes
0
answers
202
views
mkdir - create directory (with ":" in its name) does not work in specific directory, works in others
I am trying to create a directory for a movie on my Plex media server and ran into a strange issue. When I try to make a directory with the movie name ("Borat: Cultural Learnings of America for ...
0
votes
1
answer
117
views
Create directory using filenames and move the files to its respective folder
My question is a bit different than:
Create directory using filenames and move the files to its repective folder
Since in the same folder I have two similar copy of each file like:
001.txt and 001(1)....
0
votes
1
answer
234
views
How can i create sub directories within a directory? [closed]
I am trying to make a photo organizer with a zsh shell script. But i am having trouble creating sub directories within each main directory(based on date). Currently the script starts from a folder i ...
1
vote
2
answers
718
views
Creating and arranging files into folders based on date and time in file name
I have many files in a folder Main which are named like these:
2021_10_15_23_35_SIP_CDR_pid3894_ins2_thread_1_4718.csv.gz
2021_11_24_21_15_Gi_pid25961_ins2_thread_1_6438.csv.gz ...
1
vote
1
answer
417
views
Why does mkdir messes up special characters (german umlauts)?
I have a system which is set up with Debian. Running the command
mkdir xx_ü
on this system, creates a directory called 'xx_'$'\303\274'. Running the same command on a system that is set up with ...
0
votes
1
answer
78
views
Sorting long list of files into multiple sub directories based on name
I have a group of 1000+ files that are labeled using text and date in a folder /home/dir/dir2/oldspot with below format:
File taken on 01/07/2020 at 23:08 elevation 5 is
aaaaaa-bbbb-cc10dddd-L1-...
1
vote
1
answer
131
views
Setting setuid on `mkdir` without making it as executable
I am setting setuid on mkdir without making it as executable.
chmod u+s /usr/bin/mkdir
chmod u-x /usr/bin/mkdir
[root@rhel-85 /]# ls -l /usr/bin/mkdir
-rwSr-xr-x. 1 root root 84664 Jul 9 2021 /...
0
votes
1
answer
256
views
why when hooking syscalls from the kernel, is the pid of kill, zsh, but the pid of mkdir is mkdir?
I am writing my own rootkit to learn about Linux kernels. I wanted to hook into a syscall and alter the credentials of the current task to be that of roots (i.e.euid=0). I saw you could do this with ...
4
votes
1
answer
5k
views
How to create folders using user input for the name and number
The user will be asked 2 variables which will be the name of the folder and the number of folder they want to create. So if a user inputs sea and 3, the output should be: sea, sea2, sea3
read -p "...
3
votes
4
answers
766
views
How create many nested directories and defining the permission to all them in one command?
In Linux the following two commands work as expected:
mkdir -m 555 new_directory
mkdir -p a/b/c
But the following does not work as expected:
mkdir -m 555 -p a/b/c
the 3 directories are created but ...
0
votes
1
answer
239
views
Creating a directory from many variables
I want to create a script that creates a new folder with the name of the first argument in the directory specified as the second argument.
#!/bin/bash -e
## Passing Arguments (fastq data and ...
0
votes
1
answer
7k
views
mkdir gives "No space left on device" message but sudo mkdir works [duplicate]
When I try to use mkdir test in /home/, I get mkdir: cannot create directory ‘test’: No space left on device. I've deleted over 1Gb of files and restarted some processes that were using deleted files, ...
0
votes
1
answer
384
views
Using mkdir -p, is it possible to create files within subdirectories using regular expressions? [duplicate]
I am trying to create a file using the mkdir -p command.
Using mkdir -p ~/1/2/3/4, how would I put files (w,x) into /2, and (y,z) into /3 all in a single command?
I know I could use a touch command ...
-1
votes
1
answer
1k
views
mkdir error, permission denied
i was installed spotify yesterday with snap in kali linux, then i run with snap run spotify and i get error like this :
snap run spotify
WARNING: cgroup v2 is not fully supported yet, proceeding with ...
0
votes
0
answers
76
views
mkdir appending carriage return when creating folders based on variable names [duplicate]
Context
OS: Ubuntu 18.04.6 LTS
Text editor: GNU nano, 2.9.3
In the BASH script below, I'm trying to create directories using mkdir. The name of each directory is determined by a combination of ...
0
votes
1
answer
421
views
mkdir as another user based on configuration file
We have a shared Linux environment where most files are mounted to many machines on a NFSv3 share, which we do not control. Since we only have basic filesystem permissions available (No ACLs), we are ...
2
votes
1
answer
143
views
If the `-p` flag not needed anymore in `mkdir` 9.0?
I can't find any reference of this change of behaviour
$ mkdir --version
mkdir (GNU coreutils) 9.0
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <...
0
votes
1
answer
1k
views
Permissions Issue creating folder on remote host with Jenkins
I'm having an issue with using Jenkins to create a folder on a remote host.
The remote host in this case is a stock Ubuntu 20.04 AMI EC2 server with the default ubuntu user.
I am connecting with the ...
0
votes
0
answers
175
views
Mounting subdir to a new NFS
I have a directory that is mounted with NFS.
10.159.31.81:/var/lib/phone /var/lib/phone nfs hard,bg,intr,vers=3,noatime 0 0
I want to test my new NFS servers but I don't want to move everything over. ...
0
votes
2
answers
4k
views
LINUX unable to create a directory | mkdir: cannot create directory ‘test_nfs’: Permission denied
I am trying to create a new directory under /mnt but unable to do so.
I have presented a volume through nfs server to client.
-->RPCbind is active.
/mnt$ service rpcbind status
● rpcbind.service - ...
0
votes
1
answer
53
views
copy files from multiple remote machines to local and create directories for remote machines
Have multiple vm machines that am using for studying, and have come up with this script for copying some files from vm's to my local machine:
SG=rohos; date; for i in `cat /etc/hosts | grep "$SG-&...
1
vote
1
answer
1k
views
mkdir says folder exists even though it doesn't show with ls -a
Arch linux.
I have a CIFS mount from my NAS that was mounted with full permissions
# line from my fstab
//IP_ADDRESS/path/to/dir /path/to/local/dir cifs uid=my_user,gid=my_group,dir_mode=0777,...
0
votes
2
answers
931
views
How to run a remote script with sudo via ssh without entering password
I would like my script to connect to ssh with password, and once connected it will switch to sudo -s and run the mkdir command
for the moment I manage to connect to ssh without entering the password ...
5
votes
2
answers
5k
views
Synchronizing with rsync outputs error "Invalid argument (22)" for directories with dots and other symbols in their name
I tried to synchronize /dir1 (ext4) and /dir2 (ntfs) using rsync -azP, but got these errors:
rsync: recv_generator: mkdir "dir2/X.Y." failed: Invalid argument (22)
rsync: recv_generator: ...
0
votes
1
answer
204
views
Creating directories inside a directory, from variable values, to redirect output from sed
I am trying to take a file, modify this file by using a value from a for loop (using sed) and redirecting it to a directory that has been created during the same for loop.
Original file > Make ...
-1
votes
1
answer
299
views
Where is /tmp/myname located? [closed]
When using the following, I understand that I make a directory inside a directory:
mkdir /tmp/myname
but where is it located?
How can I see its parent folder?
-2
votes
1
answer
245
views
Move every 500 files in new directory [closed]
I have a directory that contains 10,665 jpeg files.
I want to move 500 files to a new directory, and 500 to the next directory, etc.
The largest files must be moved first:
500-1 contains the 500 ...
0
votes
2
answers
459
views
Directory creation using brace expansion
mkdir Public/1 2 3 ----- This line creates folder 1 in the Public folder and creates folders named 2 and 3 in my pwd.
mkdir Public/{1..3} ---- This line creates folders 1,2,3 in Public only as ...
0
votes
0
answers
40
views
Deleting read-only directory on linux? [duplicate]
I created an empty read-only directory:
mkdir -m 400 ~/Desktop/hello
As per the octal permission, it indicates the directory has read only permission.
But contrast to that when I am using the ...
-4
votes
1
answer
745
views
mkdir not working, only with mkdir -p in rootserver with plesk [duplicate]
I just ordered a new root server 18.04 Ubuntu with Plesk.
I log in as root and want to create a folder for example:
mkdir /usr/local/myfolder/hello
I get the error:
mkdir: cannot create directory ‘/...
1
vote
1
answer
146
views
How to create nested folders (start with .) properly?
I want to create the nested folder .aa/.bb in the current user root's home directory. So I use the command mkdir -p "~/.aa/.bb/". But it doesn't work as I expected and it created a folder ~, ...
0
votes
1
answer
1k
views
mkdir "No such file or directory" within a directory that exists
I have a network (samba) share mounted at /run/user/1000/gvfs/smb-share:server=wdmycloud,share=family. Most activities work fine within the share - I can move stuff around, create and delete files, ...
0
votes
2
answers
56
views
How to make sure directory only has specific subdirectories?
I have a directory that has some subdirectories with files in them. I have another directory that has very similar subdirectories but there may be a few that are added or removed. How can I add and ...
0
votes
2
answers
32
views
move contents of directory to static named subdirectory
I have directories of media structured as followed:
~ $ tree baz
baz
├── Ajin [Season 1]
│ ├── Ajin Demi-Human - 01 - A Topic That Has Nothing to Do with Us.mkv
│ ├── Ajin Demi-Human - 02 - Why Is ...
0
votes
1
answer
6k
views
mkdir error: no such file or directory
on a linux machine running CENTOS v 7.8.2003 I am in a directory Neutrinos
I now do
mkdir /pionloop/
this works. I then go to into this new directory pionloop and do
mkdir /E_0.3
and this works as ...
1
vote
0
answers
620
views
Why I cannot create a folder that does not exist (simple-mtpfs mounted filesystem)?
I am mounting my USB-connected phone using simple-mtpfs, and it is shown as fuse.simple-mtpfs when I do df.
I then switch to a folder on the external SDCARD of the phone, and try to create a folder ....
0
votes
2
answers
634
views
Creating nested directories
I want to write a bash script that will get a command line argument and create nested directories under the user home directory.
E.g a/b/c
mkdir -p $1/$2/$3
But I want create not just three levels ...
0
votes
1
answer
947
views
sudo mkdir in bash script without password
I need to manually create a directory using the following command in a cronjob and not have to enter in a password:
sudo mkdir /fold1/
I have read that I should not edit /etc/sudoers directly.
What ...
-1
votes
1
answer
117
views
How to create directory and files inside the directory
I want to know how to place files using touch command inside an directory whether it is multiple or single file.help is appreciated
1
vote
2
answers
2k
views
Can't mount /system read-write
When I make install reaver in termux the following error occurs:
./install.sh -D -m 755 wash /usr/local/bin/wash
mkdir: cannot create directory ‘/usr’: Read-only file system
make: *** [Makefile:140: ...
3
votes
1
answer
29
views
How can I quickly create all folders named {Single|Multi}Lane_{Single|Dual}Carriageway_{USA|Europe}
In Bash or Zsh, what is the shortest way to create a folder for each possible combination of substrings? Is there maybe even a notation such as
mkdir {Single|Multi}Lane_{Single|Dual}Carriageway_{USA|...