MKDIR(1) General Commands Manual MKDIR(1)NAME
mkdir - make directories
SYNOPSIS
mkdir [ -p directory_name ... ]
DESCRIPTION
Mkdir creates the directories named as operands, in the order specified, using mode 0777 modified by the current umask(2).
The options are as follows:
-p Create intermediate directories as required. If this option is not specified, the full path prefix of each operand must already
exist.
The user must have write permission in the parent directory.
Mkdir exits 0 if successful, and >0 if an error occurred.
SEE ALSO rmdir(1)STANDARDS
Mkdir is POSIX 1003.2 compliant. This manual page is derived from the POSIX 1003.2 manual page.
3rd Berkeley Distribution August 16, 1993 MKDIR(1)
Check Out this Related Man Page
MKDIR(1) BSD General Commands Manual MKDIR(1)NAME
mkdir -- make directories
SYNOPSIS
mkdir [-pv] [-m mode] directory_name ...
DESCRIPTION
The mkdir utility creates the directories named as operands, in the order specified, using mode ``rwxrwxrwx'' (0777) as modified by the cur-
rent umask(2).
The options are as follows:
-m mode Set the file permission bits of the final created directory to the specified mode. The mode argument can be in any of the formats
specified to the chmod(1) command. If a symbolic mode is specified, the operation characters '+' and '-' are interpreted relative
to an initial mode of ``a=rwx''.
-p Create intermediate directories as required. If this option is not specified, the full path prefix of each operand must already
exist. On the other hand, with this option specified, no error will be reported if a directory given as an operand already exists.
Intermediate directories are created with permission bits of ``rwxrwxrwx'' (0777) as modified by the current umask, plus write and
search permission for the owner.
-v Be verbose when creating directories, listing them as they are created.
The user must have write permission in the parent directory.
EXIT STATUS
The mkdir utility exits 0 on success, and >0 if an error occurs.
EXAMPLES
Create a directory named foobar:
$ mkdir foobar
Create a directory named foobar and set its file mode to 700:
$ mkdir -m 700 foobar
Create a directory named cow/horse/monkey, creating any non-existent intermediate directories as necessary:
$ mkdir -p cow/horse/monkey
COMPATIBILITY
The -v option is non-standard and its use in scripts is not recommended.
SEE ALSO rmdir(1)STANDARDS
The mkdir utility is expected to be IEEE Std 1003.2 (``POSIX.2'') compatible.
HISTORY
A mkdir command appeared in Version 1 AT&T UNIX.
BSD March 15, 2013 BSD
I am having trouble using cp and mkdir commands on a small script. The problem is I have spaces what I am trying to mkdir and then copy. Any suggestions on how I can solve this problem? I've tried searching online.
while read linefile
do
echo mkdir -p $CPP$linefile | cut -d / -f 1-5,8-12
... (10 Replies)
I'm trying to make use of mkdir(char *pathname, S_IRWXU) to create the directories.
but it only creates one directory at a time. so I have to separate the tokens for "/home/blah1/blah2/blah3" as "home blah1 blah2 blah3" using delimiter "/", but it is again hectic to create such directory... (8 Replies)
Dear,
I have the following script:
maak_backup ()
{
echo 'Maken van tijdelijke bestanden, even geduld aub.'
for i in /home/yannick/* ;
do
cp -r $i $i.bac
done
if ;
then
echo 'Backup map = OK!'
echo 'Bezig met kopiëren, even geduld... (9 Replies)
Hi, I have network mount on two servers.
One server I can create any directories without any issues, other server with the similar mount, I am not able to create directories starting with number!
Creation, name start with a number:
$ mkdir 1212
mkdir: cannot create directory `1212': No such... (12 Replies)
Hi All,
I am really new to Linux.I am trying to write a script for creating a new directory by getting input of folder name from the user.Please help me in this regard.
#! /bin/bash
echo "Enter name of dir":$filename
mkdir -p $filename
When executing this I am getting following error
... (13 Replies)
Hello,
I'm pretty new to scripting and trying to do a simple (well, I thought so) administrator task. I'm using bash.
I want to create 10 directories under the one directory and apply permissions at the same time.
I've worked out the make directories part: mkdir /userdata/folder{1..50}... (7 Replies)
Hi Guys
I am trying to move file containing more than two - at the 3rd line of each files to a new directory. The files are something like this :
****** Text ******
/text/
text text
I want to make sure the search effect only take place on the 3rd line one as there might me... (46 Replies)
Hi,
In a parent directory there are several files in the form
IDENTIFIER1x
IDENTIFIER1.yyy
IDENTIFIER1_Z, etc
IDENTIFIER2x
IDENTIFIER2.yyy
IDENTIFIER2_Z, etc
IDENTIFIER3x
IDENTIFIER3.yyy,
IDENTIFIER3_Z, etcIn the same parent directory there are corresponding directories named... (7 Replies)
In the below script i found that the alias mkdir_s is getting invoked from function configure() i.e the alias is kicking in.
#!/bin/bash -e
shopt -s expand_aliases
alias mkdir=mkdir_s
mkdir_s(){
if ]; then
return
else
/usr/bin/mkdir "$1"
return
fi
}
configure()
{
mkdir -p... (9 Replies)
Hi...
Thanks to read this...
I want to use mkdir to create many directories listed in a text file, let's say.
How do I do this?
Sorry for this maybe very basic question :) (13 Replies)
I have a file with lines like:
111 12 7
111 13 8
112 12 9
115 31 3
120 31 9
123 10 7
125 12
I want to make a script which, split the first column into parts (101-110, 111-120...), and make directories for its part with name (101-110, 111-120...) Also i want in every directory include... (7 Replies)
Importing images from a camera (or two).
I sort by date (1901 this month).
Currently (failing)
if ]
then
echo "Found Panasonic G9X"
#echo "List files on camera"
#ls ${pana}/*
. chxdir.sh ${photos}/$mn
I want to change directory to a fixed base ($photos)/$mn... (10 Replies)