Directory is a folder which contains various files or another directories. You will be in need to create directory at least once during your Linux-usage period. All in all, it is not so different from command prompt in Windows, the command remains the same, but there are few additional (optional) parameters that we can use.
If you type man mkdir in your Linux CLI, you will get the following output:
NAME mkdir - make directories SYNOPSIS mkdir [OPTION] DIRECTORY... DESCRIPTION Create the DIRECTORY(ies), if they do not already exist. Mandatory arguments to long options are mandatory for short options too. -m, --mode=MODE set file mode (as in chmod), not a=rwx - umask -p, --parents no error if existing, make parent directories as needed -v, --verbose print a message for each created directory --help display this help and exit --version output version information and exit
The simplest usage of command would be:
neven@squeez:~$mkdir my_folder
This would create directory with name my_folder.
If we wanted to create directory my_folder with some predefined permissions, we
would use:
neven@squeez:~$mkdir --mode=550 my_folder
This would create my_folder directory with following permissions:
neven@squeez:~$ls -l dr-xr-x--- 2 neven neven 4096 2012-03-07 15:45 my_folder
In next part of tutorial, we'll show you few more tricks for creating directories.
0 comments:
Post a Comment