File command (b) processing the command catalog


 

1. mkdir to create a directory

 

mkdir  /path/name
	 -p  创建目录,若无父目录,则创建p(parent)  

 

1.1. mkdir -p

Format :mkdir -p /path1/name1

                        1
        The figure found only one file in the tmp directory, no test files, then therefore mkdir /tmp/test/democommand error, because there is no test files, and even less to create a new file in the file does not exist, then select a command mkdir -p /tmp/test/demofound created.

※ These are the "-p" benefits:You can create a directory under the premise that no parent directory, and also create the parent directory

 

1.2. Mkdir to create multiple directories

Format : mkdir /path1/name1 /path2/name2
                                1
        The figure was found in the test tmp directory is only a demo directory, after the command mkdir /tmp/test/demo /tmp/test/demo2refers to theCreate two directories simultaneously under test, Respectively demo1, demo2.


 

2. pwd shows the current path to the specified directory and cd

Format : pwd
Format : cd /path1
                                        1
        As shown above, letWith the cd command to move to a directory, then use the pwd command displays the current absolute path, and cd ..is moving to the parent directory, the original is in the demo, the directory after the execution Back to the test; and cd .is back the current directory, not change


 

3. rmdir to delete empty directories

Format :rmdir /path1/name1

                        1
        As shown above, rmdir only removes empty directories, because the directory test under tmp, there are demo, demo1, demo2 (three empty directory) under test directory, and then delete empty directories demo can be achieved.

Published 49 original articles · won praise 21 · views 70000 +

Guess you like

Origin blog.csdn.net/qq_40520596/article/details/104761519