Skip to content

Instantly share code, notes, and snippets.

@carlessanagustin
Last active May 31, 2016 08:54
Show Gist options
  • Save carlessanagustin/d943bd67e43069e36dd74d7f954d7e4d to your computer and use it in GitHub Desktop.
Save carlessanagustin/d943bd67e43069e36dd74d7f954d7e4d to your computer and use it in GitHub Desktop.
Running processes in the background

Running processes in background

nohup

nohup COMMAND [ARG]...
echo $HOME/nohup.out

nohup make > make.log
nohup make > make.log &

help commands

ctrl+z # To pause a process and get back to the shell
jobs # Show the status of all background and suspended jobs
fg %jobnumber # Bring a job back into the foreground
bg %jobnumber # Bring a job back into the background

other commands:

dtach -A /tmp/dtach.session /bin/bash
screen
byobu
  • Method 1
  1. Run some some COMMAND
  2. ctrl+Z
  3. jobs
  4. bg %jobnum
  • Method 2
  1. Run some some COMMAND
  2. ctrl+Z
  3. jobs -l
  4. bg %jobnum &
  • Method 3
  1. Run some some COMMAND
  2. ctrl+Z
  3. bg
  4. disown -h %jobnum
  5. exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment