All Questions
29
questions
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 ...
0
votes
1
answer
163
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 ...
1
vote
2
answers
911
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 ...
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: ...
0
votes
2
answers
664
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
2
answers
691
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 ...
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|...
0
votes
2
answers
2k
views
Why does mkdir not work with wildcards? [duplicate]
nathan@gentoodesktop ~/Documents $ mkdir test
nathan@gentoodesktop ~/Documents $ mkdir te*/test
mkdir: cannot create directory 'te*/test': No such file or directory
nathan@gentoodesktop ~/Documents $ ...
0
votes
1
answer
6k
views
Loop to create subdirectories in multiple directories
I want to create subdirectories into each of directories below. I used the following loop:
#! bash
/# dir m3z m3t m3t2 m3g m3g2 m3g3 ... n dir
for d in m3z m3t m3t2 m3g m3g2 m3g3 ... n ...
5
votes
3
answers
11k
views
Bash wildcard not expanding
I'm trying to make a directory for each file in a directory.
mkdir *
returns File exists. So I try
mkdir *.d
and it makes a directory called "*.d". How do I force the wildcard to expand?
1
vote
2
answers
2k
views
Create folders and subfolders from csv/txt file
I have a excel file which i will convert to csv or txt file with following data:
ALFA ROMEO > 147 > Scheinwerferblenden
ALFA ROMEO > 156 > Scheinwerferblenden
ALFA ROMEO > 156 > ...
-2
votes
2
answers
5k
views
Bash command to create a folder and move specific files into it
I am trying to achieve this using bash
I have a directory of files, a sample to get the picture is below:
January 2010 MA - C3 Edexcel.pdf
January 2010 MS - C3 Edexcel.pdf
January 2010 QP - C3 ...
1
vote
1
answer
227
views
mkdir -p dir with braces created wrongly
I executed the following code in Ubuntu server 16.04 xenial:
mkdir -p /root/backups/{db, dirs}
I recall that in another system, it worked like charm creating all 3 dirs:
/root/backups/
/root/...
0
votes
2
answers
2k
views
mkdir with seq command problem
I need to make 5 directories (name1, name2, name3, name4, name5) by command line using mkdir and seq.
If I use:
mkdir name{`seq -s , 1 5`}
It results in one directory: name{1,2,3,4,5}
What ...
4
votes
2
answers
2k
views
Sort files in a folder into dated folders
I am trying to organize my webcam picture files into folders otherwise I get thousands of pictures in one folder.
I have a script foscam-move.sh (from Create sub-directories and organize files by ...