青铜
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).
阅读(851) | 评论(0) | 转发(0) |