1. Top Command
Top-D 1-p pid [, PID...] // set it to delay 1 s. The default value is delay 3 s.
To sort by memory usage, Shift + M (sort by memory usage)
2. pmap command
Pmap PID
3. ps command
PS aux | grep process_name
4. view the status file in the/proc/process_id/folder.
View memory usage of a single program
1. view the program status using top-P PID
2. PS-Aux | grep process_name
3. CAT/proc/Pid/status
The details of the current process are printed. The memory is vmrss.
Delete a folder (cannot be rolled back) Rm-RF
Modify the own of a file
Chown-r root. group file name
PS: chown-r root. Root/usr/local/xxx
Get root permission
Sudo Su-
Date, month, day, year, second
Date-s allows you to directly set the system time
For example, the command to set the system time to June 10, 1996 is as follows.
# Data-s 06/10/96
The command to set the system time to 01:12:00 P.M. is as follows.
# Date-s 13:12:00
Transmission between Linux
SCP/usr/local/APP (local path) root@192.168.20.99:/usr/local/usersadf
Extract
Unzip xxxx
Tar zxvf xxxx
Jar-xvf project. War
Package
Tar cvzf/usr/bak/hot-_00000000.tar.gz/usr/hot/
SSH password-free login-configure the trust relationship between the two servers A to B as an example of the sub-source machine:
Run the following command under the root user:
Ssh-keygen-T rsamv/root/. Ssh/id_rsa.pub/root/. Ssh/authorized_keys
Put the/root/. Ssh/authorized_keys file of the source machine to the directory of the target machine:/root/. Ssh/(create the. Ssh directory)
Run ssh-lroot-P22 IP address on the source machine
Enter Yes, And the password-free login is displayed.
In Linux, SSH connections are not automatically disconnected.
VI/etc/profile
Add tmout = 300 (unit: seconds)
Source/etc/profile
Complete
Search for strings in VIM
In command mode, enter/word, which is the word "word" in the search file. Is it from the top of the file to the bottom? Word: Search for the word "word" in the file, from the top of the file to the surface
How to find a file location in Linux
Locate xxxx