Back to course

63. Understanding Processes: The `ps` Command

Linux Basics: From Zero to CLI Hero

Snapshot of Running Programs

A process is an instance of a running program. Linux assigns every process a unique Process ID (PID). The ps command (Process Status) displays a static snapshot of current processes.

Common ps Options

The arguments to ps vary widely, but these two sets of options are standard for comprehensive viewing:

  1. BSD Style (aux): Shows all processes for all users, often used with pipes.

    • a: show processes for all users.
    • u: display in user-oriented format.
    • x: show processes not attached to a terminal.

    bash $ ps aux | less

  2. Standard Style (-ef): Shows processes in a full listing.

    • e: show all processes.
    • f: display full listing format.

    bash $ ps -ef UID PID PPID C STIME TTY TIME CMD root 1 0 0 Nov07 ? 00:00:05 /sbin/init user 123456 123455 0 14:00 pts/0 00:00:00 bash

  • PID: Process ID
  • PPID: Parent Process ID (which process launched this one)
  • CMD: The command that launched the process.