Ps aux in Linux

Source: Internet
Author: User

Ps aux in Linux

 

Ps aux is used to print all processes

 

Ps is the most basic and powerful process view command

 

Both aux Parameters

 

A = show processes for all users display processes of all users
U = display the process's user/owner display the user
X = also show processes not attached to a terminal: displays the process of the uncontrolled terminal.

 

In the axo to be introduced below

 

O = format, user-defined

 

1) Displaying top 10 CPU_consuming processes: displays the top 10 processes that consume the most CPU resources.
# Ps aux | head-1; ps aux | sort-rn + 2 | head-10
2) Displaying top 10 memory-consuming processes: displays the top 10 processes that consume the most memory.
# Ps aux | head-1; ps aux | sort-rn + 3 | head

 

To view custom columns we use the below command
[Root @ server ~] # Ps axo stat, euser, ruser, % mem, pid, % cpu, comm

 

Here
Stat-> status of the process
Euser-> valid user
Ruser-> real user
% Mem-> percentage of memory utilized by process
Pid-> process ID
% Cpu-> percentage of memory utilized by process
Comm-> command

 


To view top 10 memory utilized process
[Root @ server ~] # Ps axo ruser, % mem, comm, pid, euser | sort-nr | head-n 10
RUSER % MEM COMMAND PID EUSER
Root 0.4 sshd 3189 root
Root 0.4 sshd 2486 root
Root 0.2 master 1194 root
Root 0.1 rsyslogd 2918 root
Root 0.1 ps 3355 root
Root 0.1 login 1217 root
Root 0.1 bash 3191 root
Root 0.1 bash 3080 root
Root 0.1 bash 2488 root

 


To view top 10 memory utilized process
[Root @ server ~] # Ps axo ruser, % cpu, comm, pid, euser | sort-nr | head-n 10
RUSER % CPU COMMAND PID EUSER
Root 0.2 events/0 7 root
Root 0.0 watchdog/0 6 root
Root 0.0 vsftpd 1118 root
Root 0.0 vmmemctl 593 root
Root 0.0 usbhid_resumer 41 root
Root 0.0 udevd 420 root
Root 0.0 udevd 1235 root
Root 0.0 udevd 1234 root
Root 0.0 sync_supers 13 root

This article permanently updates the link address:

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.