Skip to content

Instantly share code, notes, and snippets.

@foru17
Created August 17, 2014 15:14
Show Gist options
  • Select an option

  • Save foru17/750133ce326a034a5e4d to your computer and use it in GitHub Desktop.

Select an option

Save foru17/750133ce326a034a5e4d to your computer and use it in GitHub Desktop.
linux后台运行程序
nohup node server.js > /dev/null 2>&1 &
nohup means: Do not terminate this process even when the stty is cut off.
> /dev/null means: stdout goes to /dev/null (which is a dummy device that does not record any output).
2>&1 means: stderr also goes to the stdout (which is already redirected to /dev/null).
& 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