Skip to content

Instantly share code, notes, and snippets.

@previtus
Last active September 4, 2018 02:50
Show Gist options
  • Save previtus/4a0fe734825b2040ba1d76704b8c018d to your computer and use it in GitHub Desktop.
Save previtus/4a0fe734825b2040ba1d76704b8c018d to your computer and use it in GitHub Desktop.
linux, ctrl+z, bg, fg - fun
ctrl + z = will suspend the currently foregrounded program
jobs = see suspended / running jobs with number
bg = will run in background (the most recently suspended program)
(use bg %2 with the job number, which you can check with jobs)
fg = will bring to foreground the most recently suspended program
ctrl-z to interrupt the process and then run bg to make it run in the background.
bg
You can show a numbered list all processes backgrounded in this manner with jobs.
disown -h %1 (replace 1 with the process number output by jobs) to detach the process from the terminal.
Start with:
screen
Create new window with: Ctrl-A C
Jump to next existing window: Ctrl-A N
Detach from all windows: Ctrl-A D
PS: you can start a screen in one machine and then use ssh within the windows to access whatever server workers there are.
Detaching will return you to the first machine.
Check what is running:
screen -Q windows
screen -ls
Reconnect with:
screen -r
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment