Linux Common commands

Source: Internet
Author: User
Tags file copy

1. Review the process

PS command

Enter the following PS command to display all running processes:

# PS aux | Less

which

-A: Show All processes

A: Show all processes that include other users in the terminal

X: Show the process without control terminal

Task: View each process in the system.

# ps-a# PS-E

tasks: Viewing non-root running processes

# ps-u Root-u root-n

Task: View the process that the user Vivek runs

# ps-u Vivek

2. Copying files

File Copy command CP
Command format: CP [-ADFILPRSU] source file (source) destination file (destination)
CP [option] source1 source2 source3 ... directory
Parameter description:
-A: Refers to the meaning of archive, but also refers to copying all the directories
-D: If the source file is a connection file, the connection file property is copied instead of the file itself
-F: Mandatory (force), if there are duplicates or other questions, do not ask the user, and force replication
-I: If the target file (destination) already exists, the overwrite will ask if the action is true
-L: Create a hard link connection file instead of copying the file itself
-P: Copy with the properties of the file instead of using the default properties
-R: Recursive replication for directory replication operations
-S: Copy into a symbolic connection file (symbolic link), which is the "shortcut" file
-U: If the target file is older than the source file, update the target file
If you copy file1 from the/test1 directory to the/TEST3 directory and change the file name to File2, you can enter the following command:
Cp/test1/file1/test3/file2

3. Delete Files

Third, the file Delete command rm
Command format: RM [fir] File or directory
Parameter description:
-F: Force delete
-I: Interactive mode, asking the user whether to operate before deleting
-R: Recursive delete, commonly used in directory deletion
If you delete the File1 file under the/test directory, you can enter the following command:
Rm-i/test/file1

Linux Common commands

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.