Linux Command set

Source: Internet
Author: User

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

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.