Linux directory Operations Command Daquan Linux system Development Learning

Source: Internet
Author: User

Linux the directory structureas a tree structure, the top-level directory is the root directory, other directories are added to the tree by mount, by lifting the mount to delete, in addition to the directory for other processing operations, common directory processing commands are as follows:

1. LS command (list directory)

Common usage:

Ls–a lists all files under the file, including ". "The beginning of the hidden file;

Ls–l lists the details of the file, such as creator, creation time, file read-write permission list, etc.

Ls–d lists only the directory itself, not the file data in the directory.

2. CD command (switch directory)

Usage:

CD [ relative path or absolute path ] the command used to transform the working directory.

3. pwd command (displays the current directory)

the PWD command displays the user's current working directory as an absolute path. command to write the full path name of the current directory (from the root directory) to standard output. All directories are used / delimited. The first / represents the root directory, and the last directory is the current directory. the pwd command immediately learns the absolute path name of the working directory where you are currently located.

4. mkdir(Create a new directory)

Usage:

Mkdir-m The permissions of the configuration file;

Mkdir–p the required directories (including the previous level of the directory) to be recursively created;

5. RmDir(delete an empty directory)

Usage:

Rmdir–p together with the previous level of "empty" directories are also deleted;

6. CP(copy files or directories)

Usage:

Cp-a is quite the meaning of-pdr;

Cp-d If the source file is the attribute of the link file, the link fileproperty is copied rather than the file itself;

Cp-f is mandatory (Force ) meaning, if the target file already exists and cannot be opened, then try again after removing;

Cp-i If the target file (destination) is already present, the action will be asked before overwriting;

Cp-l to create a link file for a hard link , rather than copying the file itself;

Cp-p Copies the past with the attributes of the file, rather than using the default attributes;

Cp-r Continuous replication, used for the replication behavior of the directory;

Cp-s copy becomes the symbolic link file;

Cp-u if destination than source old only upgrade destination;

7. RM(remove files or directories)

Usage:

Rm-f is the meaning of force, ignoring the non-existent file, no warning message appears;

Rm-i Interactive mode, before the deletion will ask the user whether the action;

Rm-r recursive deletion, most commonly used in directory deletion, which is very dangerous option;

the above is a more commonly used Linux Directory processing commands , this article only makes the simple grammar introduction, the concrete usage, but also needs to look for the study!

Linux directory Operations Command Daquan Linux system Development Learning

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.