mkdir command
Function: Create a directory (similar to DOS, the md command).
Syntax: mkdir [options] dirname
Description: This command creates the directory named dirname. Create a directory of the user requirements in the current directory (dirname parent directory) has write permissions, and dirname can not be the current directory has a directory or file name.
Command in the meaning of each option are:
- M of the new directory to set access privileges. Can also use the chmod command to set.
- P can be a path name. At this point, if some of the directory path does not exist, add this option, the system will automatically build a good directory that does not exist, that one can create multiple directories.
For example: in the current directory under the build inin and inin / mail directory, which is building a row of two directories.
$ Mkdir - p - m 700. / Inin / mail /
Results of the implementation of the command is nested in the current directory to create the directory hierarchy inin / mail, the main file permissions set to only have to read, write and execute permissions.
rmdir command
Function: Delete empty directory.
Syntax: rmdir [options] dirname
Description: dirname said directory name. The command to delete a directory from one or more directory entries. Needs special attention is required before a directory is deleted is empty. (Note, rm - r dir command instead of rmdir, but very dangerous.) Delete a directory must have write permissions on the parent directory.
Command in the meaning of each option are:
- P recursively remove the directory dirname, parent directory when the directory is empty after deletion, we also deleted together. If the path is deleted or retained part of the path for some reason, the system displayed in the standard output the appropriate information.
For example:
$ Rmdir - p / usr / xu / txt to / usr / xu / txt directory to delete.
Change the working directory, display directory contents command
cd command
Function: to change the working directory.
Syntax: cd [directory]
Description: This command will change the current directory to the directory specified directory. If not specified directory, then back to the user's home directory. In order to change to a specified directory, the user must have the implementation of the specified directory and read access.
The command can use a wildcard (wildcard meaning, see Chapter X).
For example: Suppose the user's current directory is: / home / xu, is to be changed to / home / xu / pro directory
$ Cd pro at this time, the user can perform the pwd command to display the working directory.
$ Pwd / home / xu / pro
pwd command
Hierarchical directory structure in Linux, the user can be authorized in any directory using mkdir command to create a new directory can also use the cd command to change from one directory to another directory. However, there is no prompt to tell the user which is currently in a directory. To know the current directory in which you can use the pwd command, which displays the entire path name.
Syntax: pwd
Description: This command shows the absolute path of the current working directory.
Cases: $ pwd / home / xu shows the path name / home / xu, each directory name is with "/" to separate the root directory to the beginning of "/" indicates.