Vol. I · No. 46The command line sectionSat, 10 Oct 2026
Linux · process & service management

nohup

keep running after logout

nohup — no hang-up — starts a command that ignores the signal sent when a terminal closes. Combined with &, it lets a long job carry on after you disconnect from SSH.

nohup command & — start it, log out, and it is still running tomorrow.

Survives
Logout
and a dropped SSH connection
Output goes to
nohup.out
unless redirected
Use with
&
to get the prompt back
For services
systemd instead
restarts, logs, limits

At the terminal

Read the session first, then the notes: each numbered line in the output is answered by the note with the same number.

user@netflow — bashcoreutils
$ nohup ./backup.sh &
1[1] 4502
2nohup: ignoring input and appending output to 'nohup.out'
3$ exit
4$ pgrep -a backup
4502 /bin/bash ./backup.sh
$ tail -1 nohup.out
copied 1240 of 5310 files
Illustrative session · names, sizes and dates are examples, and every address is from a documentation or private range
Reading the output

What the numbered lines are telling you

1
Started in the background

The job number and process id. Note the id: it is how you will find the process later.

2
Where the output is going

With no terminal to print to, output is appended to nohup.out in the current directory.

3
Logging out

Normally this would end the script. Because of nohup, it keeps running.

4
Still there in a new session

After logging back in, the process is running and its progress can be read from nohup.out.

Variations worth knowing

The same tool, pointed at a narrower question. These four cover most of what it is reached for day to day.

nohup ./job.sh > job.log 2>&1 &

Sends both output and errors to a log file of your choosing.

tmux new -s work

A session you can detach from and return to — better for interactive work.

systemd-run --user ./job.sh

Runs the command as a temporary systemd unit, with logging.

disown -h %1

Protects a job that is already running from the hang-up signal.

In cybersecurity

A process that outlives your login is easy to forget and hard to notice.

Persistence

nohup is the simplest way to leave something running on a machine. Processes whose parent is init and that belong to a user who is not logged in are worth a look.

nohup.out collects everything

The output file grows without limit and may contain credentials the command printed. Redirect it somewhere deliberate, with sensible permissions.

It is not a service manager

Nothing restarts the process if it crashes, and nothing stops it. For anything permanent, write a systemd unit.

Filed under

Process & service management

Read alongside