Linux Basic command One (file management)

Source: Internet
Author: User
Tags create directory

1.uname: View version information

1.0

1.1

2.pwd: Displays the current directory (print working directory)

3.CD: Switching/changing directory (change directory)

3.0 CD [Relative path or absolute path]

3.1 [.] Represents this Layer directory

3.2 [..] Represents a previous level directory

3.3 [-] represents the previous working directory

3.4 [~] represents the home directory where the "current logged in user identity" resides

4.mkdir: Create directory (make directory)

4.0 mkdir [-p] Directory name

4.1 [-P] creating multi-level catalogs

5.rmdir: Delete directory (make directory)

5.0 rmdir [-p] Directory name

5.1 [-p] creating multi-level catalogs

6.ls: List Directory contents (list)

6.0 ls [-AADHL]

6.1 [-A] displays all directories and files, including "." and ".."

6.2 [-A] Displays all directories and files, excluding "." and ".."

6.3 [-d] lists only the directory itself, not the file data in the directory

6.4 [-h] Lists the file capacity in a human-readable way (for example, GB, KB, etc.)

6.5 [-l] Lists files and displays information such as properties and permissions for the file

Example: Ls-lh;ls-ld

7.CP: Copying (copy)

7.0 CP [-ADFILPRSU] source file destination (the target can be a file name or a directory name)

7.1[-A]: As far as possible, the file status, permissions and other information are reproduced as original.

7.2[-R] If the source contains a directory name, the files under the directory are also copied to the destination.

7.3[-F] If a destination already has a file with the same file name, it should be deleted before copying.

# #在默认的条件中, the source file for CP is different from the destination file, and the owner of the destination file is the user who executes the command.

7.4[-U] Differential replication, commonly used in backups

7.5[-A] Copy all the attributes of a file, such as a group with file permissions

Example: Copy the/etc/passwd file to/tmp as root

7.6[-F] If the destination already has the same file name of the file exists, then before the copy is deleted and then copied, in fact, is the meaning of force, forced replication, the default is to ask

7.7[-u] Incremental retest, if there are some files in the copy is not copied, the default is to ask the

8.MV: Move files, and rename function (move)

8.0 mv [-FIU] source destination

8.1[-F]: Force move, no warning message appears

8.2[-i]: ask you before moving

8.3[-u]: When the target is present, only the source is newer

9.RM: Delete files and directories (remove)

9.0 RM [-IFR] File name or directory

9.1[-f] Forced Delete, no prompt message

9.2[-i] Prompt message before deletion

9.3[-r] Recursive Delete

Answers to several FAQs on the Web:

1. renaming files and folders

1 // renaming a file Old_file->new_file 2 MV Old_file New_file 3 Rename Old_file new_file 4 5 // renaming a file Old_dir-->new_dir 6 MV Old_dir New_dir

2. File Batch Rename: Shell script

3.find command usage: unknown origin

  

Linux Basic command One (file management)

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.