Linux ps command to view the CPU and memory usage sorting of processes

Source: Internet
Author: User
Tags time and date

Run the following command to View Details:

PS-Aux | sort-K4, 4n

PS auxw -- Sort = RSS

PS auxw -- Sort = % CPU

 

PS commands in Linux

% CPU usage of CPU Processes
% Mem process memory usage
The size of the virtual memory used by the vsz Process
The size of the resident set or actual memory used by the RSS Process
Tty terminal associated with the process (TTY)
Stat check status: Process status is represented by characters, such as R (running is running or ready to run), S (sleeping sleep), I (idle), and Z (stiff), D (uninterruptible sleep, usually I/O), P (waiting for switching page), w (switching out, indicating that the current page is not in memory), n (low-priority task) T (terminate), W has no resident pages

Start (process start time and date)
Time; (total CPU time used by the process)
Command (the command line command being executed)
Ni (NICE) Priority
PRI process priority number
Ppid parent process ID (parent process ID)
Sid session ID (session ID)
The name of the kernel function in which the wchan process is sleeping. The name of the function is obtained from the/root/system. Map File.
Flags: process-related numerical identification

Common Parameters
-A displays all processes (equivalent to-E) (utility)
-A displays all processes of a terminal, except session leads.
-N ignore selection.
-D: display all processes, but omit all session leads (utility)
-X: displays the processes that do not control the terminal and the specific path of each command. DX cannot be used together. (Utility)
-P time when the PID process uses the CPU
-U uid or username: select a valid user ID or user name
-G gid or groupname: displays all processes in the group.
U username displays all processes under the user and detailed paths of each command. For example, ps u Zhang; (utility)
-F is all listed. It is usually used with other options. For example, PS-FA or PS-Fx and so on.
-L long format (including F, wchan, C, and other fields)
-J job format
-O User-Defined Format.
V is displayed in Virtual Memory Format
S is displayed in Signal Format
-M: Display All threads
-H: displays the process level (used with other commands, such as PS-ha) (utility)
Environment (for example, PS-d e; PS-a e) (utility)
H does not show the first line

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.