Terminal Processes Flashcards
Foreground
Processes executed on terminal run in foreground by default (recieve input from keyboard, send output to screen)
Background
For processes that don’t require keyboard input, can send to background to run in parallel with & (or ^Z, then bg)
&
symbol/character represents “execution in the background”
./program &
nohup
(no hang up): used as a prefix when starting a background process so you can log off and the process keeps executing
nice
used as a prefix for command to modify niceness(scheduling priority) , -20 (most favorable) and +19 (least favorable)
Gary’s Analogy: you don’t expect nice to be something to be a command, if you’re nice you’ll let other people go ahead of you.
SIGCHILD
death of a child signal
Parent reaps
What is a PPID?
Parent Process ID: Every process has a parent that started it, tracked using PPID
init or launchd
Processes are heirarchial. init or launchd can be thought of as the root of the process tree
pstree
pstree: this command shows the relationship of all processes in a tree-like structure
UID (Process ID)
UID: user ID that this process belongs to (the person running it)
C (Process ID)
CPU utilization of processor
TTY
Terminal type associated with the process
TIME
CPU time taken by the process
CMD
The command that started this process
Child Process: fork( )
In unix a child process is created when the parent process invoke the fork ( )