Questions tagged [mkdir]
The mkdir tag has no usage guidance.
159
questions
569
votes
4
answers
693k
views
recursive mkdir
Is there a linux command that I'm overlooking that makes it possible to do something along the lines of:
(pseudo)
$ mkdir -R foo/bar/zoo/andsoforth
Or is there no alternative but to make the ...
279
votes
13
answers
150k
views
Is there a one-liner that allows me to create a directory and move into it at the same time?
I find myself repeating a lot of:
mkdir longtitleproject
cd longtitleproject
Is there a way of doing it in one line without repeating the directory name? I'm on bash here.
252
votes
4
answers
196k
views
Combined `mkdir` and `cd`? [duplicate]
is there any way (what is the easiest way in bash) to combine the following:
mkdir foo
cd foo
The manpage for mkdir does not describe anything like that, maybe there is a fancy version of mkdir? I ...
192
votes
2
answers
284k
views
How to create nested directory in a single command? [duplicate]
Apparently, it's not possible to create a nested directory in a single command?
$ sudo mkdir x/y/z
mkdir: cannot create directory 'x/y/z': No such file or directory
71
votes
1
answer
102k
views
How to create a file and parent directories in one command? [duplicate]
Is there a flag/option for touch, mkdir, >, or some other command that will allow me to create a file and any non-existent parent directories at the same time?
For instance, let's say I'm in an ...
47
votes
9
answers
20k
views
mkdir -p for files
mkdir -p will create a directory; it will also make parent directories as needed.
Does a similar command exist for files, that will create a file and parent directories as needed?
43
votes
4
answers
121k
views
Is mkdir -p totally safe when creating folder already exists
Say I have a folder:
./folder/
Inside it there are many files and even sub-directories.
When I execute:
mkdir -p folder
I won't see any errors even warnings.
So just want to confirm, is there ...
27
votes
3
answers
63k
views
Creating multiple nested directories with one command
How can I create multiple nested directories in one command?
mkdir -p /just/one/dir
But I need to create multiple different nested directories...
15
votes
3
answers
4k
views
Why did my folder names end up like this, and how can I fix this using a script?
Sorry if this has an answer elsewhere, I've no idea how to search for my problem.
I was running some simulations on a redhat linux HPC server, and my code for handling the folder structure to save ...
13
votes
1
answer
2k
views
How many directories can be nested?
I'm curious, how many folders can be nested, and why? Is there a limit?
What I mean by nested is when folders are in this structure:
folder
|_ folder
|_ folder
|_ folder
|...
12
votes
4
answers
8k
views
Recursively create directories for all letters
I want to create a directory in such a way that I need to label the directories from a to z. Inside each of these directories, I need to create sub-directories so that they are labelled as aa, ab etc. ...
10
votes
5
answers
5k
views
Create the same subfolders in another folder
I have a directory foo with subdirectories. I wish to create the same subdirectories names in another directory without copying their content. How do I do this?
Is there a way to get ls output as a ...
9
votes
2
answers
11k
views
Deleted /tmp accidently
Accidently, I ran sudo rm -r /tmp, is that a problem ?
I recreated it using sudo mkdir /tmp, does that fix the problem ?
After I recreated the directory, In the places section in the sidebar in ...
8
votes
1
answer
11k
views
How does 'Create New Folder' short-key work?
In many file managers there is a shortcut/key to create a new folder. In Nautilus, Thunar, Panthon-Files, this is Ctrl+Shift+N, in Dolphin it is F10.
How does this shortcut work?
I imagine that ...
7
votes
2
answers
6k
views
Is it possible to detect file or folder creation/deletion in real time?
I want to monitor file or folder creation/deletion instantaneously, is it possible?
EDIT:I am using Ubuntu 16.04