Android Linux shell

49 阅读1分钟

Linux shell

ps

crosshatch:/ $ ps --help

usage: ps [-AadefLlnwZ] [-gG GROUP,] [-k FIELD,] [-o FIELD,] [-p PID,] [-t TTY,] [-uU USER,]

List processes.

Which processes to show (-gGuUpPt selections may be comma separated lists):

-A  All -a  Has terminal not session leader

-d  All but session leaders -e  Synonym for -A

-g  In GROUPs -G  In real GROUPs (before sgid)

-p  PIDs (--pid) -P  Parent PIDs (--ppid)

-s  In session IDs -t  Attached to selected TTYs

-T  Show threads also -u  Owned by selected USERs

-U  Real USERs (before suid)


Output modifiers:


-k  Sort FIELDs (-FIELD to reverse) -M  Measure/pad future field widths

-n  Show numeric USER and GROUP -w  Wide output (don't truncate fields)


Which FIELDs to show. (-o HELP for list, default = -o PID,TTY,TIME,CMD)


-f  Full listing (-o USER:12=UID,PID,PPID,C,STIME,TTY,TIME,ARGS=CMD)

-l  Long listing (-o F,S,UID,PID,PPID,C,PRI,NI,ADDR,SZ,WCHAN,TTY,TIME,CMD)

-o  Output FIELDs instead of defaults, each with optional :size and =title

-O  Add FIELDS to defaults

-Z  Include LABEL

ps -ef -p