Linux - ps (process statut)
About
Report a snapshot of the current processes.
To get a repetitive update of the selection and of the displayed information, use top.
This ps works by reading the virtual files in /proc.
Management
tree
To print a process tree:
ps -ejH
ps axjf
thread
ps -eLf
ps axms
Process - (Kernel) Thread (Lightweight processes - LWP)
user process
ps -u oracle -f
UID PID PPID C STIME TTY TIME CMD
oracle 13502 13499 1 14:09 ? 00:01:09 sshd: oracle@pts/2
oracle 13503 13502 0 14:09 pts/2 00:00:00 -bash
oracle 16382 16380 0 14:44 ? 00:00:00 sshd: oracle@notty
oracle 16383 16382 0 14:44 ? 00:00:00 /usr/libexec/openssh/sftp-server
oracle 16430 16415 0 14:44 ? 00:00:00 sshd: oracle@notty
oracle 16431 16430 0 14:44 ? 00:00:00 -bash
oracle 17442 1 0 14:59 ? 00:00:01 /u01/app/oracle/product/11.2.0/db_1/bin/tnslsnr LISTENER -inh
oracle 29107 13503 0 15:39 pts/2 00:00:00 man ps
oracle 29110 29107 0 15:39 pts/2 00:00:00 sh -c (cd /usr/share/man && (echo ".ll 9.8i"; echo ".nr LL 9.
oracle 29111 29110 0 15:39 pts/2 00:00:00 sh -c (cd /usr/share/man && (echo ".ll 9.8i"; echo ".nr LL 9.
oracle 29116 29111 0 15:39 pts/2 00:00:00 /usr/bin/less -is
oracle 29224 13503 0 15:42 pts/2 00:00:00 ps -u oracle -f
- Sort
ps -ao pid,user,args --sort user
full output
ps -ef | grep <process>
where the flag:
- -e selects every process
- -f chooses the “full” output format
full with parameters
For complete information about the process including all parameters
ps auxww | grep <process>
where:
- a lists all processes on a terminal, including those of other users,
- x lists all processes without controlling terminals
- u adds a column for the controlling user for each process.