Commands used for Linux server statistics

Source: Internet
Author: User

Similar to windows resource manager, it dynamically displays the usage of processes, memory, and cpu.

Top-d 1

 

Ps aux | more

Ps sorting

Ps aux | sort-k4, 4n

Ps auxw -- sort = rss

Ps auxw -- sort = % cpu

Sort ps aux-sort =-uid in descending order of uid

 

Sort ps aux-sort =-pcpu by cpu usage in descending order

Ps aux-sort = pmem in ascending order by mem usage

A displays all processes on the terminal, including those of other users.

X shows the process without any control terminal.

The size of the resident set or actual memory used by the RSS Process

The size of the virtual memory used by the VSZ Process

% MEM process memory usage

STAT check status:

The Process status is represented by characters, such

R (running is running or preparation ),

S (sleeping), I (idle ),

Z (stiff), D (uninterrupted sleep, usually I/O ),

P (waiting for the switch page ),

W (Out, indicating that the current page is not in memory ),

N (low-priority tasks ),

T (terminate termination ),

W has no resident pages

@ View disk capacity
[Root@www.linuxidc.com/] # df-H.
View system users
Cat/etc/passwd
After a new user is created, the user information will be added to the/etc/passwd file in the following format:
[User name]: [Password]: [UID]: [GID]: [identity description]: [main directory]: [Login Shell 〕
The fields are divided into seven parts by the colon.
Because the UID and GID smaller than 500 are generally retained by the system itself, there is no need to mark common users and groups,
Therefore, newly added users and groups generally have UID and GID greater than 500.
The lastlog file is queried every time a user logs on.
You can use the lastlog command to check the last logon time of a specific user and format the last logon log/var/log/lastlog.
It displays the logon name, port number (tty), and last logon time according to the UID sorting.
If a user has Never logged on, lastlog displays ** Never logged **.
Note that you need to run this command as root. Run the following command:
[Root@www.linuxidc.com log] # lastlog
Username Port From Latest
View Current and logged-on users
Who
If the wtmp file name is specified, the who command queries all previous records.
The command who/var/log/wtmp will report every login since the wtmp file was created or deleted.
Who/var/log/wtmp
In my opinion, you can also use the last command, with the same effect.
You can also view the logon information of a specific user, for example:
Last reboot
Last root
 

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.