# ps -ASample Outputs:
PID TTY TIME CMD
1 ? 00:00:02 init
2 ? 00:00:02 migration/0
3 ? 00:00:01 ksoftirqd/0
4 ? 00:00:00 watchdog/0
5 ? 00:00:00 migration/1
6 ? 00:00:15 ksoftirqd/1
....
.....
4881 ? 00:53:28 java
4885 tty1 00:00:00 mingetty
4886 tty2 00:00:00 mingetty
4887 tty3 00:00:00 mingetty
4888 tty4 00:00:00 mingetty
4891 tty5 00:00:00 mingetty
4892 tty6 00:00:00 mingetty
4893 ttyS1 00:00:00 agetty
12853 ? 00:00:00 cifsoplockd
12854 ? 00:00:00 cifsdnotifyd
14231 ? 00:10:34 lighttpd
14232 ? 00:00:00 php-cgi
54981 pts/0 00:00:00 vim
55465 ? 00:00:00 php-cgi
55546 ? 00:00:00 bind9-snmp-stat
55704 pts/1 00:00:00 ps
ps is just like top but provides more information.Show Long Format Output
# ps -AlTo turn on extra full mode (it will show command line arguments passed to process):
# ps -AlFTo See Threads ( LWP and NLWP)
# ps -AlFHTo See Threads After Processes
# ps -AlLmPrint All Process On The Server
# ps ax
# ps axuPrint A Process Tree
# ps -ejH
# ps axjf
# pstreePrint Security Information
# ps -eo euser,ruser,suser,fuser,f,comm,label
# ps axZ
# ps -eMSee Every Process Running As User Vivek
# ps -U vivek -u vivek uSet Output In a User-Defined Format
# ps -eo pid,tid,class,rtprio,ni,pri,psr,pcpu,stat,wchan:14,comm
# ps axo stat,euid,ruid,tty,tpgid,sess,pgrp,ppid,pid,pcpu,comm
# ps -eopid,tt,user,fname,tmout,f,wchanDisplay Only The Process IDs of Lighttpd
# ps -C lighttpd -o pid=OR
# pgrep lighttpdOR
# pgrep -u vivek php-cgiDisplay The Name of PID 55977
# ps -p 55977 -o comm=Find Out The Top 10 Memory Consuming Process
# ps -auxf | sort -nr -k 4 | head -10Find Out top 10 CPU Consuming Process
# ps -auxf | sort -nr -k 3 | head -10
No comments:
Post a Comment
comment.........