Linux Labs

Users, permissions, and processes / Stage 10 of 13

Observing processes

Not running Starting usually ~20 s
Leave the lesson

Step 3 of 7 · on a machine · 5 min

A process row in ps

pgrep found three indexers. ps shows who started them and how they differ.

ps prints a snapshot of processes at the moment it runs. The -C option picks processes by program name, and -o picks the columns to show:

Column What it holds
PID the process number
PPID the parent's number: the process that started this one
USER the account the process runs as
COMMAND the command line: the program and its arguments

Processes start other processes: this is how your shell starts every command you type. The number of the process that started it is under PPID.

Exercise · look

Who started the three indexers

Run both commands: pgrep -a prints the PID and command line of every process with index in its name, and ps prints the rows of the three indexers with the chosen columns.

First, predict

How many different numbers will the PPID column show for the three indexers?

Now start the exercise, run the command and compare your prediction with the output.

Sign in and start The machine is available after signing in

The indexer command line begins with /usr/bin/python3: the program is written in Python, and the python3 interpreter runs it. The word after the program name is an argument: --site, --docs, or --blog. Arguments are how you tell processes of one program apart when their numbers say nothing.

Ubuntu 24.04
Loading…