17. Processes

  • & - Spawning

17.1. PID

  • PID files

  • pidof

  • /var/spool/pid

17.2. Problems

  • Deadlock

  • Starvation

  • Race Condition

17.3. Killing

  • kill

  • kill -9

  • killall

17.4. Keyboard Shortcuts

  • ctrl+c

  • ctrl+d

  • ^% - escape sequence

17.5. Priorities

  • nice

17.6. Commands

Table 17.1. Processes

Command

Type

Description

htop

interactive process viewer

jobs

kill -9

kill

send a signal to a process

kill

send signal to a process

killall

kill processes by name

lxc

memusage

profile memory usage of a program

nice

run a program with modified scheduling priority

nice

change process priority

nohup

run a command immune to hangups, with output to a non-tty

nproc

print the number of processing units available

pidof

find the process ID of a running program.

pidwait

look up, signal, or wait for processes based on name and other attributes

pkill

look up, signal, or wait for processes based on name and other attributes

pkill

(3pm)

Kill all instances of a process by pattern matching the command-line

pmap

report memory map of a process

ps aux

ps

report a snapshot of the current processes.

pslog

report current logs path of a process

pstree

display a tree of processes

renice

alter priority of running processes

screen

screen manager with VT100/ANSI terminal emulation

skill

send a signal or report process status

time

run programs and summarize system resource usage

time

get time in seconds

time

overview of time and timers

timeout

run a command with a time limit

times

get process times

top

display Linux processes

wait

wait for process to change state

watch

execute a program periodically, showing output fullscreen

fork

(3am)

basic process management

fg

move process to foreground

bg

move process to background

free

allocate and free dynamic memory