mkdir command
Function: Create a directory (similar to the md command under MSDOS).
Syntax: mkdir [options] dir-name
Description: This command creates the directory named dir-name. Create a directory of the user requirements in the current directory (dir-name of the 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 to set access permissions on the new directory. 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.
rmdir command
Function: delete empty directories.
Syntax: rmdir [options] dir-name
Description: dir-name that the 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. rm - r dir command instead of rmdir, but 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.
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).
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.
ls command
ls is a list of abbreviated English words, their functions are listed in the directory contents. This is the user one of the most commonly used as a command, because the users need from time to time to view the contents of a directory. Under the command similar to the DOS dir command.
Syntax: ls [options] [directory or file]
For each directory, the command will list all the subdirectories and files them. For each file, ls will output the file name and other information requested. By default, the output entries alphabetically. When not given a directory name or file name, to display the current directory information.
Command in the various options mean the following:
- A show all subdirectories under the specified directory and files, including hidden files.
- A show all subdirectories under the specified directory and files, including hidden files. But do not list "." And ".."。
- B on the file name in the non-display characters with octal escape character display.
- C sort by file modification time.
- C into the multi-column display.
- D if the argument is a directory, instead display only shows the name of the file under it. Often used in conjunction with the l option to obtain directory information.
- F do not sort. This option will lts options fail, and to aU option effective.
- F behind the tag name in the directory "/" executable behind the mark "*" sign behind the link marked "@", pipe (or FIFO) behind the tag "|", socket file back marked "=."
- I in the output of the first column shows the file i node number.
- L for long format to display the file details. This option is most commonly used.
The information listed in each line are: file type and file permissions are a few links to the main document file size is set the time to create or modify the name of the recent
For the symbolic link file, the file name displayed after the "->" and the reference file path name.
For device files, the "file size" field shows the main, the minor device number, not the file size.
The total number of blocks in the directory displayed in the beginning of a long list of formats, including indirect blocks.
- L if the specified name is a symbolic link file, it shows the link points to a file.
- M output by character stream format, the file inter-page display, separated by commas.
- N l option with the same output format, but is in the output file is a group of owners is the appropriate UID and GID numbers to represent numbers, not the actual name.
- O l option with the same, just do not show the owner information.
- P in the directory later add a "/."
- Q will not be displayed in the file name characters with "?" Instead.
- R reverse order or in alphabetical order of first priority display output.
- R recursive directory displays all subdirectories in the specified file.
- S for each directory entry is given the number of blocks used, including indirect blocks.
- T is displayed by modification time (most recent first) instead of sorting by name. If the file is modified the same time, according to the dictionary order. Modified depends on whether u choose to use the c or the top. The default time is the last modification time mark.
- U is displayed by file last access time (latest first) instead of sorting by name. -T time to mark the forthcoming revised last visit time.
- X by line item shows the sort of information.
Using ls - l command to display the message, at the beginning of a 10-character string, the first of a character file type, it can be one of the following types:
- Regular file
d directory
l symbolic link
b block device file
c character device file
9 behind the characters that the file access, divided into 3 groups 3.
The first group that documents the rights owner, the second group of said groups of users with permissions, the third group that the other user permissions. Each group of three characters, respectively, of the document read, write and execute permissions.
The permissions are as follows:
r read
w write
x implementation. For the catalog, said access privileges.
s when the file is executed, the UID or GID of the file given to the implementation process UID (user ID) or GID (group ID).
t set the flag (left in memory, not swapped out). If the file is a directory, files in the directory can only be super-user, the directory owner, or file owner to delete. If it is an executable file, the file is executed, a pointer pointing to the body of the paragraph remained in the memory. This re-execute it, the system will be able to quickly load the file.
没有评论:
发表评论