Linux Common commands

Source: Internet
Author: User

Since the project project is using a Linux server, more Linux commands are used to record the commands commonly used in CentOS.

1. Three modes of VIM

2, decompression related

3. User-related

4. File related

5. Various view commands

1. Three modes of VIM

VI File name//command line mode, enter the file

Enter I//insert mode to edit the file

Click ESC, enter colon//Bottom line mode, enter Wq, save and exit; q! Do not save exit

2, decompression related

XXX.tar.gz Decompression: TAR-ZXVF XXX.tar.gz

Xxx.tar for decompression: TAR-XVF Xxx.tar

Xxx.zip for decompression: Unzip Xxx.zip

3. User-related

useradd New//Create new user
password new//Set password for new
su New//Switch to new this user
Password//change password for current user

4. File related

mkdir New//Create a folder with the name new

Touch New/new01.txt//New file under folder is New01.txt

chmod 755 New01.txt//Authorized all user access rights

CP Source path/File destination path///copy source file to destination path

SCP Source server/File destination server/File//server replication

Rm-rf folder or file//do not prompt and delete

MV Source path/File destination path/File//Move source file to destination path

MV filename. txt file name 1.txt//modify file name

5. Various view commands

Df-lh                                                  //view disk information
Lsb_release-a         &NBS P                        //View system version information
Free   &NBSP ;                          ,         &NB Sp              //view memory information
Top                 & nbsp                          ,         &NB Sp  //view occupy resource top resource process

Netstat-anpl|grep Service//View service port number
PS-EF|GREP Service Name//See if the service is installed

Ps-aux | grep Service//Check whether the service is running

NETSTAT-TULNP//View the ports on which the listening state is turned on

Netstat-anp|grep port number//view ports usage

tail-f filename// will display the last content of filename on the screen

Linux Common 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.