nohup command
Keep a command running after you log out.
- Processes & services
- Package coreutils
- 5 options · 4 examples
Syntax
nohup command [args] &Provided by the coreutils package. Run man nohup for the full manual.
Common options
| Option | What it does |
|---|---|
& | Run in the background |
> FILE 2>&1 | Send output to a file |
jobs | List background jobs |
fg / bg | Bring to the foreground / continue in background |
disown | Detach a running job from the shell |
Examples
Run a script that survives logout
nohup ./long-task.sh &Choose the log file
nohup ./server.sh > server.log 2>&1 &Detach a job you already started (Ctrl+Z, then)
bg && disownList background jobs
jobs -l
No example matches. Check the options table or search the guides.
nohup guides
- How to change Background Color of Text in Linux Shell Linux Commands · Updated Apr 2025
- How To Run Command In Background on Linux Linux Commands · Updated Apr 2025
- How to Move Running Command to Background in Linux Linux Commands · Updated Apr 2025
- Changing the Login Screen Background in Ubuntu 22.04 & 20.04 Linux · Updated Apr 2025
