Skip to main content

Questions tagged [mkdir]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
64 views

Missing files but system said it exist!

I have a working folder with all output files generated from command. When I tried to re-coding one of my file, after a few attempts, I realized the files in my folder left only 1/3 of them! I first ...
web's user avatar
  • 193
1 vote
1 answer
111 views

fstab and systemd automount overlay

On an embedded device based on Yocto Linux my rootfs is RO, while I have an additional partition for RW data. Now I want to automount at boot an overlay onto /etc stored on a different partition. Here ...
Martin H.'s user avatar
  • 171
1 vote
2 answers
112 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:~$ ...
ant's user avatar
  • 29
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}}
internet's user avatar
  • 101
1 vote
1 answer
342 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 /...
user avatar
0 votes
0 answers
1k 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 ...
Mer's user avatar
  • 9
-2 votes
1 answer
613 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. ...
bara's user avatar
  • 19
2 votes
1 answer
263 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 . # ...
milkpirate's user avatar
0 votes
2 answers
2k 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/...
aaa's user avatar
  • 167
0 votes
1 answer
158 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 ...
CodeMed's user avatar
  • 5,239
0 votes
1 answer
20 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 ...
user546640's user avatar
0 votes
0 answers
352 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 ...
Saar Koren's user avatar
1 vote
1 answer
744 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)....
Maxfield's user avatar
  • 161
0 votes
1 answer
293 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 ...
Mathijs's user avatar
1 vote
2 answers
870 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 ...
nidooooz's user avatar
1 vote
1 answer
574 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 ...
Thomas's user avatar
  • 166
0 votes
1 answer
98 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-...
Lucas Djeu's user avatar
1 vote
1 answer
136 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 /...
meallhour's user avatar
  • 181
0 votes
1 answer
308 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 ...
sys_overflow's user avatar
4 votes
1 answer
6k 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 "...
Raegor's user avatar
  • 43
4 votes
4 answers
965 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 ...
Manuel Jordan's user avatar
0 votes
1 answer
434 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 ...
Manuel Dominguez Becerra's user avatar
0 votes
1 answer
9k 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, ...
vietnamese_chowder's user avatar
0 votes
1 answer
551 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 ...
Opensource1397's user avatar
-1 votes
1 answer
2k 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 ...
Rachmat Ashari's user avatar
0 votes
0 answers
79 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 ...
akoontz11's user avatar
0 votes
1 answer
564 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 ...
anthozep's user avatar
  • 101
2 votes
1 answer
155 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 <...
Jon's user avatar
  • 123
0 votes
1 answer
2k 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 ...
Programster's user avatar
  • 2,279
0 votes
0 answers
231 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. ...
Dovid Bender's user avatar
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 - ...
Harshita's user avatar
0 votes
1 answer
82 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-&...
Ve-Khan's user avatar
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,...
Jared Smith's user avatar
0 votes
2 answers
1k 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 ...
Scripting's user avatar
6 votes
2 answers
7k 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: ...
Igor V.'s user avatar
  • 321
0 votes
1 answer
244 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 ...
Nankin's user avatar
  • 5
-1 votes
1 answer
404 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?
axcelenator's user avatar
-2 votes
1 answer
270 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 ...
Fakhamatia's user avatar
0 votes
2 answers
657 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 ...
Lucifer G's user avatar
0 votes
0 answers
41 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 ...
Phaneendra's user avatar
-4 votes
1 answer
1k 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 ‘/...
zer02's user avatar
  • 95
1 vote
1 answer
175 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 ~, ...
Just a learner's user avatar
0 votes
1 answer
2k 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, ...
c-x-berger's user avatar
0 votes
2 answers
58 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 ...
FrostyTigerXP's user avatar
0 votes
2 answers
34 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 ...
anonymous's user avatar
0 votes
1 answer
8k 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 ...
user3584513's user avatar
1 vote
0 answers
737 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 ....
Luis A. Florit's user avatar
0 votes
2 answers
688 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 ...
Խաչատուր Մելքոնյան's user avatar
0 votes
1 answer
1k 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 ...
iso's user avatar
  • 35
-1 votes
1 answer
136 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
Arun Sanga's user avatar