Skip to content

Instantly share code, notes, and snippets.

@CoolOppo
Last active August 29, 2015 14:00
Show Gist options
  • Save CoolOppo/11242149 to your computer and use it in GitHub Desktop.
Save CoolOppo/11242149 to your computer and use it in GitHub Desktop.
Run a command in the background in Ubuntu

Use (setsid yourcommand &), it detaches from the tty and works equally in interactive and script modes.

( spawns a subshell, which handles job control differently.

Or use nohup yourcommand > /dev/null 2>&1 &

Tags

  • Linux
  • Shell
  • Bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment