Skip to content

Instantly share code, notes, and snippets.

@vinsim24
Created September 23, 2017 18:51
Show Gist options
  • Save vinsim24/3a0887c08d4c6bd74d20633538bfff2f to your computer and use it in GitHub Desktop.
Save vinsim24/3a0887c08d4c6bd74d20633538bfff2f to your computer and use it in GitHub Desktop.
Nohup command usage
nohup node server.js > /dev/null 2>&1 &
1. nohup means: Do not terminate this process even when the stty is cut off.
2. > /dev/null means: stdout goes to /dev/null (which is a dummy device that does not record any output).
3. 2>&1 means: stderr also goes to the stdout (which is already redirected to /dev/null). You may replace &1 with a file path to keep a log of errors, e.g.: 2>/tmp/myLog
4. & at the end means: run this command as a background task.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment