"ps" - Display Current Processes

Provides a tutorial example on how to use 'ps' command to display current process on the system.

What Is Process? - A process is a unit of work that is currently running in the operating system. A process has the following basic properties:

You can use the "ps" command to display current processes and their properties. Here are some examples:

1. Display processes associated with the current terminal session using the "ps" command with default options.

herong$ ps
  PID TTY          TIME CMD
 1171 pts/1    00:00:00 sleep
 1172 pts/1    00:00:00 ps
31723 pts/1    00:00:00 bash

2. Display processes in long format using the "ps -l" command.

herong$ ps -l
F S   UID   PID  PPID  C PRI  NI ADDR SZ WCHAN  TTY          TIME CMD
0 S  1000  1195 31723  0  80   0 -  1820 hrtime pts/1    00:00:00 sleep
0 R  1000  1213 31723  0  80   0 - 11191 -      pts/1    00:00:00 ps
0 S  1000 31723 31720  0  80   0 -  6271 -      pts/1    00:00:00 bash

3. Display processes owned by myself or another user using the "ps -u" command.

herong$ ps -u
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
herong     878  0.0  0.0   9800  2624 pts/0    S+   04:37   0:00 less
herong    1344  0.0  0.0  57184  3792 pts/1    R+   05:17   0:00 ps -u
herong    1345  0.0  0.0   9528  2192 pts/1    S+   05:17   0:00 more
herong   29872  0.0  0.0  24700  5372 pts/0    Ss   Aug24   0:00 -bash
herong   31723  0.0  0.0  25084  5704 pts/1    Ss   02:29   0:00 -bash
...

herong$ ps -u joe
...

4. Display all processes on the system in long format using the "ps -el" command:

$ ps -el
F S   UID   PID  PPID  C PRI  NI ADDR SZ WCHAN  TTY       TIME CMD
4 S     0     1     0  0  80   0 - 61833 -      ?     00:03:09 systemd
1 S     0     2     0  0  80   0 -     0 -      ?     00:00:01 kthreadd
1 I     0     3     2  0  60 -20 -     0 -      ?     00:00:00 rcu_gp
1 I     0     4     2  0  60 -20 -     0 -      ?     00:00:00 rcu_par_gp
1 I     0     8     2  0  60 -20 -     0 -      ?     00:00:00 mm_percpu_wq
1 S     0     9     2  0  80   0 -     0 -      ?     00:00:00 ksoftirqd/0
1 I     0    10     2  0  80   0 -     0 -      ?     00:02:42 rcu_sched
...

Table of Contents

 About This Book

 Introduction to Linux Systems

 Cockpit - Web Portal for Administrator

Process Management

"ps" - Display Current Processes

 "jobs" - Manage Background Jobs

 "tmux" - Terminal Multiplexer

 Files and Directories

 Users and Groups

 File Systems

 Installing CentOS

 SELinux - Security-Enhanced Linux

 Network Connection on CentOS

 Software Package Manager on CentOS - DNF and YUM

 Running Apache Web Server (httpd) on Linux Systems

 Running PHP Scripts on Linux Systems

 Running MySQL Database Server on Linux Systems

 Running Python Scripts on Linux Systems

 vsftpd - Very Secure FTP Daemon

 Postfix - Mail Transport Agent (MTA)

 Dovecot - IMAP and POP3 Server

 Email Client Tools - Mail User Agents (MUA)

 GCC - C/C++ Compiler

 Conda - Environment and Package Manager

 Tools and Utilities

 References

 Full Version in PDF/EPUB