Questions tagged [mkdir]
Use this tag for questions about the bash coreutils mkdir command.
83
questions
0
votes
1
answer
245
views
mkdir: cannot create directory '{filename}': File exists
For context I'm using rclone to copy a folder into a mnt point.
This works until I try to remount, I get the following error
mkdir: cannot create directory 's3': File exists
However when I browse to ...
0
votes
1
answer
71
views
How to create a directory with current date without linebreak
Moin!
I'm using Ubuntu 22.04. I try to create a directory with a shell script. I searched already for solutions, but all what I found creates a folder with a line break at the end.
I tried this:
sudo ...
0
votes
1
answer
103
views
Why am I getting errors in apt after I deleted and then re-created `/tmp`, `/var/tmp`, and `/var/log`?
Why am I getting an error after running the following commands?
sudo rm -r /tmp
sudo rm -r /var/tmp
sudo rm -r /var/log
sudo mkdir /tmp
sudo mkdir /var/tmp
sudo mkdir /var/log
sudo apt update
Error ...
0
votes
0
answers
34
views
Ubuntu general user mkdir testing
I have generic question about testing mkdir command,firstly I dont have root access, I am user xyz , I will create mkdir dump && chmod 777 dump , now is there a possibility in linux where i ...
-2
votes
1
answer
101
views
Error concatenating directory path in a bash script
I have over-complicated this problem with if/then scripts and super simple one line commands but for some reason I keep getting stumped.
I am trying to create a new directory a-e and place the files a,...
1
vote
0
answers
20
views
mkdir: cannot create directory [duplicate]
Hello I have the following bash code:
#!/bin/bash
arr=( "$@" )
echo "${arr[1]}"
echo "${arr[3]}"
echo "${arr[2]}"
mkdir "${arr[1]}/segments"
echo `...
0
votes
1
answer
72
views
Creating a folder from QML with /bin/sh -c mkdir
Hi I'm trying to create a folder from QML with a QProcess call:
qproc.start("/bin/sh -c 'mkdir -p /tmp/x'");
It doesn't do anything. Nor does it return any error.
From what I read, this ...
0
votes
1
answer
171
views
Syntax error when creating directory with spaces, parentheses, apostrophe, and question mark [duplicate]
I know that this probably has something to do with escaping characters, and that there might be similar questions asked already, but this is a tricky combination that I can't figure out.
On my Plex ...
0
votes
1
answer
193
views
retroarch Error while read-only file system
I installed a snap of retroarch. When i run,it show below error in image
fazil@acer:~$ retroarch
mkdir: cannot create directory ‘/home/fazil/snap/retroarch’: Read-only file system
retroarch error ...
0
votes
0
answers
236
views
how to create multiple subfolders in pyhton using subprocess?
On my ubuntu 20.04 when I use
mkdir -p /home/parent/{child1,child2}
in my terminal I get a folder parent with 2 subfolders child1 and child2.
parent
parent/child1
parent/child2
However, when I try ...
0
votes
1
answer
217
views
mkdir while true loop stops at 406 folders
Can anyone explain why my script stops making folders at 406 folders and tell me a way to get it working?
#!/bin/bash
rm -rf infinite2
while true
do
mkdir infinite2
cd ./infinite2
mkdir infinite1
...
1
vote
0
answers
24
views
running series of commands gives other result than running them on script [duplicate]
this is the script:
#!/bin/sh
rm -rf git/
mkdir -p git/{c,ds/{include,test},projects,quizzes,system_programming}
find git/ -type d -exec touch {}/dummy.md \;
This is the wanted result:
git/
├── c
│ ...
0
votes
1
answer
14k
views
How to resolve mkdir : missing operand error in linux?
I am very new to the linux , i am trying to make a directories from the files which is present in the current working directory, one directory is created but another one is not creating it's throwing ...
2
votes
1
answer
505
views
Create Directories From String Array
I have an array of directory names. I wanna create directories from the array. This is my code.
WATCHED_MOVIE_LIST=("Tenet", "Inception", "Interstellar", "Arrival&...
-1
votes
1
answer
339
views
I can't edit anything in my disk
I install Ubuntu latest version by formatting my windows( New volume:C) so that there is no data lose of my other disc. But now I can't delete/create a new folder/paste in this disc. Please tell me ...
6
votes
1
answer
2k
views
Missing Downloads folder
I'm using Ubuntu 20.04 LTS. Suddenly today, my Downloads folder went missing. After googling the problem, I used mkdir to create a new Downloads folder. It was created successfully, but the files ...
0
votes
1
answer
1k
views
sudo mkdir -p parent/child | Permission Denied
This seems like such a Day 0 problem. I need to create a 2-level folder structure.
I tried:
sudo mkdir parent/child
>>> mkdir: cannot create directory ‘parent/child’: No such file or ...
0
votes
0
answers
181
views
Any directories I create have permission 777
Anytime I create a directory (with mkdir, or if git creates it, etc) it's given these permissions:
drwxrwxrwx 2 username usergroup 2 Apr 6 20:36 test/
I'd rather have permissions of ...
1
vote
2
answers
444
views
How to Make Directories with the Same Parent Name
How to Make Directories with the Same Parent Name?
In my library, I have the following layout:
DataFolder
PATIENT A
FOLDER1
FOLDER2
FOLDER#
PATIENT B
...
0
votes
0
answers
20
views
make and the mkdir command behaving differently on MacOX vs Ubuntu 20.04 [duplicate]
I have discovered something odd with the mkdir command when it is being used in a Makefile and it behaving differently between OSX and Ubuntu 20.04.
Just wondering if this is expected behaviour, or ...
0
votes
3
answers
813
views
What determines default directory permissions? [duplicate]
In Linux when I create a directory mkdir newdir then the newly created directory has these permissions and ownership: drwxr-xr-x 2 owner group
My Question
How can I make the default permissions for ...
0
votes
1
answer
163
views
How to create a directory "dir" with subdirectories from subdir00 to subdir10 each of which contains subdirectoriess from subsubdir00 to subsubdir10?
So, dir contains subirectories from subdir00 to subdir10 and each subdirectory contains subirectoriess from subsubdir00 to subsubdir10.
mkdir -p dir/subdir0{0..9}/subsubdir0{0..9}
works fine, but how ...
0
votes
1
answer
447
views
Run command one after the other from bash script
I'm trying to run some commands one after the other, but I think I'm making some mistake since only the first command is being run.
I have a bash script that is like:
#!/bin/bash
sudo su && ...
0
votes
0
answers
38
views
How to make tar extract to new directory with option to create directory if not present? [duplicate]
The tar command has option to extra a file (file_name.tgz) into given directory (directory_name). ie.,
tar -zxf file_name.tgz -C directory_name
But it fails, if I try to run the above command, ...
3
votes
1
answer
356
views
mkdir variable Dont work
I need to create a script for school but it doesn't seem to work,
#!/bin/bash
echo "hoeveel vakken heb jij deze periode?"
read $AANTAL
if [ -d "/home/school/jaar_1/periode_4" ];
...
0
votes
1
answer
341
views
Directory creation using mkdir and touch [closed]
I need to create directory structure using mkdir for directory creation and touch for creating files using only relative paths.
-1
votes
1
answer
383
views
How to create a new directory and switch into it from the command line? [closed]
Using the command line, how can I create new directory and navigate into it?
For example, I would like to create a new directory named CSIS536 under my home directory, and change to the directory.
0
votes
0
answers
714
views
How to create the directory structure using mkdir for directory creation and touch for creating files?
Command written by me:
mkdir -p mydir/{ colors/{basic/{red,blue,green},blended/{yellow,orange,pink}},shape/{circle,square,cube},animals/{mammals/{platypus,bat,dog},reptiles/{snakes,crocodile,lizard}}}
...
1
vote
1
answer
2k
views
mkdir inside sh, won't work
I am trying to create directory using mkdir inside sh file, when I do that the directory is created, but then when trying to do something to it, I get the message "rm: cannot remove '/testFolder': No ...
-1
votes
1
answer
9k
views
Directory locations when using WSL
I'm new to the Ubuntu world and I need some help. (Windows 10, Ubuntu 18.04 LTS, x64 system type)
I created a directory called "Submarine" using this :
mkdir Submarine
I want the directory "...
1
vote
3
answers
7k
views
Permission denied creating directory after switching user
I switched to a different user with the su command, and now I want to create a file/folder but "permission denied" error appears.
safi_test4@safi-VirtualBox:/home/safi$ su safi_test4
Password:
...
0
votes
0
answers
3k
views
mkdir - read only system
Newby here (it has been decades since I have used UNIX.)
Linux (ubuntu) on a chromebook.
From the opening of the command shell I issue ls and I get a bunch of directories. I want to create a sub-...
1
vote
0
answers
773
views
Problem while executing a Makefile
i'm installing the Rocket-Chip repository.
I'm following the instructions from https://github.com/chipsalliance/rocket-chip.
The instructions are:
$ git clone https://github.com/ucb-bar/rocket-chip....
1
vote
0
answers
1k
views
Cannot make folders in the mounted partition
I have mounted an NTFS partition on Ubuntu 18.04 using the ntfsfix command. However, I cannot create the folders either using mkdir or right-click → New Folder (the option is active, not greyed ...
0
votes
2
answers
360
views
Is it possible to unzip documents into a directory which is created on the fly in a single command?
How can I achieve something like the following?
unzip ./zipped_docs.zip ./new_folder | mkdir ./new_folder
Or
mkdir ./new_folder | unzip ./zipped_docs.zip ./new_folder
I even tried
mkdir ./...
2
votes
2
answers
1k
views
Create a folder with the date as part of the name in tcsh
I often need to create folders that start with the current date.
For example 190627_ABCD.
I've tried to create an alias command that gets the date to be printed:
a newf 'mkdir `date '+%y%m%d'_`+='
...
4
votes
1
answer
2k
views
Creating directory on cifs mount returns error, but directory is indeed created
I have mounted an external disk connected to an ASUS router, which implements a Samba server. Everything works just fine except one annoying thing: creating a directory with mkdir returns an error ...
0
votes
1
answer
4k
views
mkdir in bash script: mkdir: cannot create directory ‘’
I have the following code on my bash script:
#!/bin/bash
# vars
BACKUP_DIR= /opt/odoo12/database_backup_test
# create a backup directory
mkdir -p -v "${BACKUP_DIR}"
When the script is executed, ...
1
vote
1
answer
3k
views
how to recover /etc/udev/rules.d file structure?
To troubleshoot driver issues I decided on renaming
/etc/udev/rules.d
into
/etc/udev/rules.d.gold
A brilliant idea, because now I am unable to revert my changes:
mkdir: cannot create directory ...
23
votes
3
answers
173k
views
Can't make new dir with mkdir
When I run
mkdir ../../bin/Release_Linux/Resources
Im getting an error
$ mkdir ../../bin/Release_Linux/Resources
mkdir: cannot create directory ‘../../bin/Release_Linux/Resources’: No such file or ...
0
votes
0
answers
27
views
Autocreation of folder in every location I worked
I share my user with a few people.
I have an issue: every time I work in a directory, another directory inside my working directory is created.
I checked my alias, bashrc - no any command to create a ...
-1
votes
1
answer
73
views
how to create folders with sub folders using defined variables?
I have files having below formatting:
2017-05-01-1500-00S.SRO___001_BH_Z
2017-05-01-1543-04S.SRO___001_BH_E
2017-05-01-1543-04S.SRO___001_BH_N
2017-05-01-1543-04S.SRO___001_BH_Z
2017-05-01-1600-00S....
0
votes
2
answers
355
views
Using the mkdir terminal command
I've installed the dependencies, downloaded the source files, then installed the 'Reicast' Dreamcast console emulator. I now need to create the directory for the bios and flash files: mkdir .local/...
0
votes
3
answers
442
views
Is there a way to create a new directory, containing subdirectories and documents?
For web-development practice I'm using a LAMP stack, on Ubuntu 17.10. For this I'm creating directories within /var/www, each directory is named after a project.
To create a subdirectory I use the ...
1
vote
1
answer
1k
views
making new directory in Ubuntu
I'm new to Ubuntu (18.04 LTS) and need to install a software (Juliapro) on it. based on the manual, I installed the per-requisit by TERMINAL, but for installing the script file in below path
>> ...
0
votes
1
answer
47k
views
cp: target ... is not a directory - why does this happen? [closed]
alan:~/LIME_SRC/soapySDR$ mkdir mybuild
alan:~/LIME_SRC/soapySDR$ cd mybuild
alan:~/LIME_SRC/soapySDR/mybuild$ cp /LIME_SRC/soapySDR/name "CMakeLists.txt" /LIME_SRC/soapySDR/mybuild
cp: target '/...
0
votes
1
answer
612
views
Copy differences between two dirs to a a new dir?
Edited version to a rushed question!
When I run diff on two directories ex: $ diff Linux1 Linux2
The output being $ Only in Linux2: COMPLETELYDIFFERENT22.txt
I want to the copy that file(not just ...
2
votes
1
answer
8k
views
why and how isn't mkdir working
how does mkdir work? I've been trying to install java, and when I type:
mkdir -p /usr/local/java
nothing happens except the terminal just writes it down. when I get to later steps, it says that ...
10
votes
2
answers
10k
views
Why does mkdir fail (no such file or directory) in a script with BIN_DIR="~/bin/"?
Why does the mkdir command fail with: "No such file or directory"?
#!/bin/bash
set -e
BIN_DIR="~/bin/"
if [ ! -d "$BIN_DIR" ]; then
mkdir "$BIN_DIR"
fi
0
votes
1
answer
1k
views
sudo mkdir permissions
I added the option umask=007 at the end of session optional pam_umask.so in the /etc/pam.d/common-session file. It is working fine as intended for all users.
However, I can't figure out how to ...