linux daily --ps

参考了《鸟哥的linux私房菜》,man

1.ps概述:

-report a snapshot of the current processes.

-ps display information about a selection of the active processes. If you want a repetitive update of the selection and the displayed information, use top instead.

 

2.参数:

-A:Select all processes. Identical to -e.

-a:Select all processes except both session leaders

-u:Select by effective user ID or name.

x:Lift the BSD-style "must have a tty" resctriction, which is imposed upon the set of all processes when some BSD-style (without -) options are used(like a). The set of processes selected in this manner is in addition to the set of processes selected by other means. An alternate description is that this option causes ps to list all processes owned by you (same EUID as ps). or to list all processes when used together the a option.

l:Display BSD long format

-l:Long format. the -y option is often useful with it

j:BSD job control format.

-j:Jobs format

-f:Do full format listing.

 

3.一些例子:

(1)打印属于本次登陆的的PID相关信息

ps -l:

➜ ps -l
F S UID PID PPID C PRI NI ADDR SZ WCHAN TTY TIME CMD
0 R 1000 4675 16235 0 80 0 - 3478 - pts/3 00:00:00 ps
0 S 1000 16179 4603 0 80 0 - 6982 wait pts/3 00:00:00 bash
0 S 1000 16235 16179 0 80 0 - 11815 rt_sig pts/3 00:00:00 zsh

 

 

 

 

posted @ 2014-01-31 23:10  Ben·lucky  阅读(236)  评论(0编辑  收藏  举报