-
-
Save VarunAgw/9f116276a45939f37769 to your computer and use it in GitHub Desktop.
Process in background
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Move running process in background | |
A) Ctrl + Z (It suspends (like pause) process) | |
B) bg (Its keeps running in background) | |
Move new process in background | |
A) sleep 10 & (Print output to terminal whenever it comes) | |
A) nohup sleep 10 & (Saves output to a file nohup.out) | |
A) sleep 10> /dev/null & (output is lost) | |
Move background process to foreground | |
B) fg (Bring it to foreground) | |
C) fg %1; fg %2 (with job id) | |
Get processes | |
A) ps (Show foreground/background processes) | |
A) jobs (Show background processes with status) | |
A) jobs -l (Show PID too) | |
Kill | |
A) kill %pid% | |
B) kill -9 %pid% (If A don't work) | |
Misc | |
A) !! (Repeat last command) | |
B) echo $! (Echo last PID (not works for service)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment