Manage Processes

Whenever you run a command or an application on a Linux system, the operating system’s kernel spawns a new process. You can list your current processes using the ps command.

 
pi@raspberrypi ~ $ ​ps
 
PID TTY TIME CMD
 
1880 pts/2 00:00:00 bash
 
1892 pts/2 00:00:00 ps

At the moment, you own only two processes. The first has the process ID (PID) 1880, and it belongs to a command named bash. (The process IDs on your system will vary.) This is the process that belongs to the shell in which you’re currently working. The process with the PID 1892 belongs to the ps command you’ve used to list your current processes. At the moment, you see the output of the ps command; process 1892 will be gone already. To see the effect, run ps

Get Raspberry Pi, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.