Summary Linux command list
A Linux command that creates a new directory. "mkdir" is an abbreviation for "make directory".
$mkdir directory name
#hoge directory creation
$ mkdir hoge
option | Description |
---|---|
-m | Create a directory with permissions |
-p | Create if the described directory does not exist without displaying an error |
-v | Display the message as a result of creating the directory |
$ mkdir -m Permission specification directory name
#Create a hoge directory with permissions of 666.
$ mkdir -m 666 hoge
If the directory you are trying to create exists in mkdir, an error will occur and the directory will not be created. If you recreate the directory even though it already exists, the contents of that directory will also be deleted. Also, mkdir will generate an error and the child directory will not be created even if the parent directory to be created does not exist. The -p option solves these problems. By specifying -p, you can create a child directory without displaying an error message even if the directory exists and leaving the existing directory as it is without creating a new one.
$ mkdir -p directory name
#If there is currently a hoge directory, ignore it, otherwise create a hoge directory.
$ mkdir -p hoge
pwd, mkdir, cd , cat, cp, ls, touch, less, mv, rm, ssh, man, ** Adding at any time **
We undertake various development and construction contracts and mentor work for beginners. If you are interested, please go to ** here **
Recommended Posts