Linux Common commands

Source: Internet
Author: User
Tags create directory

System:
Sync Synchronizing data from memory to the hard disk (shutdown ago)
Shutdown-h Now Shutdown-r Now shutdown-h xxx turn off the machine now Restart now xxx minutes after shutting down the machine
Reboot Restart

Vi/vim Editor:
Vi/vim xxx Edit XXX File
I (General mode) a o Insert before cursor Insert after cursor Insert Next line
ESC (edit mode) Edit mode returns to General mode
DD (General mode) d Digital D yy y digit y u p DW yw x x shift+g shift+g+1 shift+g+ number shift+^ shift+$ Delete the line where the cursor is located Delete (number) line after cursor Copy the line where the cursor is located Copy the line after the cursor (number) Revoke Paste Delete a word Copy a word del BACKSPACE move to end of page move to top of page move to (number) line move to the beginning of the line move to end of line
: (General mode) Enter instruction mode
: Set nu (instruction mode) : Set Nonu Show Line Numbers Hide Line Numbers
W Q ! %s/old character/new character/g Save Exit Mandatory Execution Replace
/ N Shift+n Find Find the next Find Previous
  User/Group: 
Useradd Add user
Userdel-r Delete command
whoami/who am I View Current User
Id Whether the user exists
passwd New User Settings password
USERMOD-G User Group user name To join a user to a user group
Su-user name Switch users
Groupadd Add Group
Groupdel Delete a group
Groupmod-n New group name old group name Renamed
 file directory: Create directory delete directory Td>
pwd show current directory
ls-l show directory contents
mkdir rmdir
CD directory CD: CD ~ CD/
CP  copy file or directory
rm-rf recursively delete contents in directory
 Search:
Find Find a file or directory
Grep The lines within the file that match the search string
 Process:
Ps-aux Show All Processes
Kill-9 Process Number Force Kill Process
Netstat-anp Display Network statistics
 Compression/Decompression:
gzip gunzip Compact. GZ unzip. GZ
zip unzip compress. zip unzip. zip
TAR-ZCVF xxx.tar.gz< /span>tar-zxvf xxx.tar.gz -c generate. Tar package files -v Show details -f Specify the compressed file name -z packaging and compressing the -x unpacking. tar file compression tar.gz unzip tar.gz
 file permissions:
chmod three-digit Modify File/directory permissions
CHGRP Final Destination Group files/directories Modify a file/directory to belong to a group
Chown End user is modified file chown End User: Modified file for landing user group Modify File/directory owner
Umask View default Authorization Rules
 RPM:
Rpm-qa To query all installed RPM packages
RPM-IVH RMP Package Full path name Installing the RMP Package
RPM-E RMP Package Full path name Uninstalling the RMP Package
        

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.