[state-Embedded notes] [005] [Detailed Linux commands]

Source: Internet
Author: User
Tags clear screen create directory

User Management class commands

Add User: Useradd name

Delete User: Userdel-r name "-r" means to delete the corresponding user's directory

Change Password: passwd name

Switch User: Su-name "-" means that the switch user is brought into the environment variable at the same time

Add user group: Groupadd name

Delete user group: Groupdel name

File and Directory class commands

Clear screen: Clear

View table of Contents: LS name "-a" means show All Files "-L" to show details

Switch directory: cd name "..." Returns the previous directory "-" indicating that the last catalog was returned

Copy file: CP src DST "-r" means copy directory

Move or rename: mv src DST Delete file or directory: RM name "-r" means delete directory "-F" means Delete does not prompt

To change file permissions:

chmod who+mode Name

Who:u indicates that the file owner G represents the file all groups o means that other User a represents all users

mode:+ means Add permission-Represents a Cancel Permission = represents a given permission

Create directory: mkdir name "-P" indicates continuous creation of directories

View directory Size: Du name view current path: pwd

Compress packaging Commands

. Tar indicates files packaged with the tar command

. GZ indicates files compressed with the gzip command

. bz2 represents a file compressed with the BZIP2 command

Compression decompression

Compression: gzip name Bzip2 name

Decompression: gzip-d name bzip2-d name

Packaging compression

Package: Tar cvf newname.tar oldname

Unpacking: Tar xvf name

Package compression: Tar zcvf newname.tar oldname

Unpacking: Tar zxvf name

Disk Management class commands

Load device: Mount device name mount directory to convert device files to directories to access

Uninstalling the device: Unmount mount Directory

View Disk: Df-hl

Create File: Touch name

View File size: filename name

File Link: ln fliename linkname "-S" means creating a soft link, otherwise creating a hard link

Find Class command

Find File/directory: Find lookup path-name file name

Find the string in the file: grep "string" path "-rn" indicates the number of lines and filenames in the file that lists the string

Process Management class commands

View process: PS aux

Kill process: Kill PID

View Memory: Free

View CPU Share: Top

Miscellaneous commands

Software Management: RPM package "-IVH" means installation package "-qa" means to view installed packages "-e" means uninstalling installed packages

Pipe operators: Command 1 | Command 2 The output of the first command as input to the second command

View Help: Man command name

Shutdown: Shutdown now or Poweroff

[state-Embedded notes] [005] [Detailed Linux commands]

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.