Linux daily test command record

Time:2021-2-25

Linux daily test command record

(1) List all processes under the current server user:

 ps -xf

(2) View the command for the process.

PS - EF | grep process name

(3) Command to view ports:

Netstat - ntlp // view all current TCP ports

Netstat - ntulp | grep 80 // view the usage of all 80 ports

(4) Command to view log:

Tail - f log file name
Tail log file name

(5) To view the redis command:

1. Redis-cli - a password // connect to redis
2. Select library number // select the corresponding redis library
3. Keys * // view the key values corresponding to redis

(6) Start / stop Tomcat process:

Path: under the bin directory of Tomcat startup.sh        //Start Tomcat
sh  shutdown.sh       //Stop running tomcatkill - 9 process number // stop running process

(7) Start ActiveMQ:

sh activemq start

(8) Download / upload / delete files

SZ file name // download file
RZ file name // upload file
RM - RF file name / folder name // delete file or folder
RM - RF * // delete all files in the current path

(9) VI edit command:

VI file name // enter the VI edit file page

sign out:
保存sign out: 按Esc后,:wq Enter
正常sign out:文本没有经过改动  :q Enter
不保存sign out::q! Enter

(10) Compressed folder:

zip -r jxkyf_20170306.zip jxkyf

(11) Other common uses:

View the server memory instruction: Top MEM line;
View server disk occupancy: DF - H;
List the file information under the current path (list vertically): ll
List the file information under the current path (listed horizontally): LS
End the current log: Ctrl + C
Query current path: PWD
Query server time: Date
Return to the home directory: CD 
Enter the logs directory, that is, enter the log: CD logs
Switch path: CD.. / other directory
View history command: History