The mkdir (make directory) command in the Unix, DOS, OS/2 and Microsoft Windows operating systems is used to make a new directory. The underlying system call is also called mkdir(). In DOS, OS/2 and Windows the command is often abbreviated to md.
Questions tagged [mkdir]
36 questions
17
votes
5 answers
mkdir that overwrites any existing directory
If I try to run mkdir build to create a build directory, if the directory already exists, this error is thrown: A subdirectory or file build already exists.. I need to delete and overwrite this directory. What is the command for that?
Shawn Mclean
- 393
- 4
- 6
- 17
17
votes
3 answers
Powershell silent mkdir
Is there a way to use mkdir (aka md) in powershell without verbose output? Currently, the output is as follows:
PS C:\Users\myusername> mkdir foobar
Directory: C:\Users\myusername
Mode LastWriteTime Length Name
---- …
user672409
14
votes
5 answers
How do I tell mkdir to try creating dir1, and if it already exists create dir2, etc, until it hits a name that doesn't exist?
I want to create a directory with a number at the end, e.x. "dir1", and increment that number if the directory already exists until it hits a directory name that doesn't exist, and I need to do this in a single line in a Linux command line,…
01AutoMonkey
- 314
- 3
- 10
11
votes
2 answers
Bash File/Folder Permission Issue on Windows 10
mkdir creates folders with 777 permission by default. How can I make 755 default?
Also when I clone a git repository all the files and folders are downloaded with 777 permission! How can I correct this problem?
Thanks.
misaligar
- 213
- 1
- 2
- 5
11
votes
4 answers
Multiple directories: Powershell equivalent of "mkdir dir{1..9}"?
What is the syntax to create multiple directories with PowerShells md (or mkdir, New-Item...) equivalent to the 'nix command mkdir ch{1..9} i.e.
~/parent_dir/
ch1/
ch2/
ch3/
ch4/
ch5/
ch6/
ch7/
ch8/
ch9/
I've looked in the man…
MmmHmm
- 738
- 11
- 24
9
votes
1 answer
Force Windows use .EXE on PATH rather than CMD.EXE internal command
When I execute a command with the same name as an internal command, instead of searching in the path Windows simply uses the one found in CMD.EXE.
For example, MKDIR is an internal command built into CMD.EXE. It does not support the same options as…
umop aplsdn
- 243
- 1
- 6
3
votes
1 answer
Need a fix for MKDIR
I've been using OmniGraffle as a drawing tool for a textbook I'm writing.
Up to today I've drawn the drawing, saved it as a graffle.
I then, export the same graffle drawing as a png, as per my publisher's requirements.(With NO problems)
This morning…
Paul
- 31
- 1
3
votes
1 answer
How to recursively create subfolder in each folder of a directory in CMD
Let's say I have a directory called Grandparent
Inside this directory are multiple other folders, Parent 1, Parent 2, etc.. My goal is to create a new folder, Child, inside each of the Parent folders.
For example, what I have:
Grandparent/
…
amallard
- 157
- 1
- 1
- 7
3
votes
1 answer
Why can't I create a folder in c:\folder\*\folder?
So I want to create a folder inside a 2nd level of subfolders.
So if I follow other example given here:
FOR /d %A IN ("e:\corporate folder\*") DO mkdir "%A\2015"
And change it to:
FOR /d %A IN (C:\folder\*\folder1) DO mkdir "%A\Arq"
Do I need to…
João Santos
- 43
- 4
2
votes
2 answers
moving directories after grep
I have isseued the next command in order to move some directories to the "build_tools" folder
however the result was not the one I expected.
ls -l | grep 2014-03 | awk '{if ($8!=build_tools) print $8}' | xargs mkdir build_tools/{} && mv {}/…
poissonbreaker
- 21
- 2
2
votes
1 answer
How can I create several folders?
How can I create several subfolders in folder in one command.
For example, I want to create:
/home/user/*create dir1*/*create dir2*/*create dir3*/
Provided, I don't have dir1. And I can't use 3 command, and can't use shell script.
This creating…
bboybboy
- 23
- 2
2
votes
1 answer
Make and open linux directory with one commmand
Instead of doing:
mkdir build
cd build
or:
mv build build_2017_03_03
cd build_2017_03_03
What is one command that does both?
user1271772
- 225
- 2
- 8
1
vote
1 answer
mkdir -p is "ambiguous" what should I do?
When I type in "mkdir -p" windows powershell spits out that the parameter p cannot be used because it is ambiguous, any idea what I am doing wrong?
Thanks
CharlotteJoy
- 13
- 3
1
vote
1 answer
Why isn't Interix mkdir honoring -p argument?
I'm using Interix on Windows for Unix compatibility and am finding the -p argument to mkdir not behaving as I expect:
> which mkdir
C:\SFU\bin\mkdir
> mkdir -p c:\Program Files\
A subdirectory or file -p already exists.
Error occurred while…
WilliamKF
- 7,778
- 34
- 103
- 145
1
vote
2 answers
Windows cannot find "mkdir"
I was trying to create a folder from a Rainmeter skin which didn't work and didn't even yield an error message. Therefore I pasted the command (mkdir C:\Users\%USERNAME%\Foo) used in Rainmeter into the Execute window (Win+R) and got the error…
FallenWarrior
- 153
- 2
- 8