青铜
ps -ef|grep 1670
oracle 1670 1 0 2020 ? 00:00:06 ora_smon_orcl
oracle 124252 116448 0 22:16 pts/0 00:00:00 grep --color=auto 1670
白银
ps -Fp 1670
UID PID PPID C SZ RSS PSR STIME TTY TIME CMD
oracle 1670 1 0 718226 83820 0 2020 ? 00:00:06 ora_smon_orcl
黄金
[oracle@db1 ~]$ ps -eo s,comm|sort|uniq -c|sort -nbr|head
7 S bioset
6 S bash
3 S sshd
3 S sqlplus
3 S kdmflush
2 S xfs-reclaim/dm-
2 S xfs-eofblocks/d
2 S su
2 S sort
2 S ora_scmn_orcl
[oracle@db1 ~]$ ps -eo s|sort |uniq -c|sort -nbr
219 S
1 R
[oracle@db1 ~]$ ps -Leo s,comm,wchan|sort |uniq -c|sort -nbr|head
7 S bioset rescuer_thread
6 S bash do_wait
4 S gmain poll_schedule_timeout
3 S tuned poll_schedule_timeout
3 S sshd poll_schedule_timeout
3 S polkitd poll_schedule_timeout
3 S kdmflush rescuer_thread
2 S xfs-reclaim/dm- rescuer_thread
2 S xfs-eofblocks/d rescuer_thread
2 S su do_wait
[oracle@db1 ~]$ ps -eLo state,user,comm|grep "^[RD]"|sort|uniq -c|sort -nbr
1 R oracle ps
[oracle@db1 ~]$ ps --help all
Usage:
ps [options]
Basic options:
-A, -e all processes
-a all with tty, except session leaders
a all with tty, including other users
-d all except session leaders
-N, --deselect negate selection
r only running processes
T all processes on this terminal
x processes without controlling ttys
Selection by list:
-C command name
-G, --Group real group id or name
-g, --group session or effective group name
-p, p, --pid process id
--ppid parent process id
-q, q, --quick-pid
process id (quick mode)
-s, --sid session id
-t, t, --tty terminal
-u, U, --user effective user id or name
-U, --User real user id or name
The selection options take as their argument either:
a comma-separated list e.g. '-u root,nobody' or
a blank-separated list e.g. '-p 123 4567'
Output formats:
-F extra full
-f full-format, including command lines
f, --forest ascii art process tree
-H show process hierarchy
-j jobs format
j BSD job control format
-l long format
l BSD long format
-M, Z add security data (for SELinux)
-O preloaded with default columns
O as -O, with BSD personality
-o, o, --format
user-defined format
s signal format
u user-oriented format
v virtual memory format
X register format
-y do not show flags, show rss vs. addr (used with -l)
--context display security context (for SELinux)
--headers repeat header lines, one per page
--no-headers do not print header at all
--cols, --columns, --width
set screen width
--rows, --lines
set screen height
Show threads:
H as if they were processes
-L possibly with LWP and NLWP columns
-m, m after processes
-T possibly with SPID column
Miscellaneous options:
-c show scheduling class with -l option
c show true command name
e show the environment after command
k, --sort specify sort order as: [+|-]key[,[+|-]key[,...]]
L show format specifiers
n display numeric uid and wchan
S, --cumulative include some dead child process data
-y do not show flags, show rss (only with -l)
-V, V, --version display version information and exit
-w, w unlimited output width
--help
display help and exit
For more details see ps(1).
阅读(953) | 评论(0) | 转发(0) |