nohup To Run Commands After You Log Out Of An SSH Session

nohup

 

 nohup.

The nohup is really useful if you use the ssh command to log onto other machines.

So what does nohup do?

Imagine you are logged on to another computer remotely using ssh and you want to run a command that takes a long time and then exit the ssh session but leave the command running even though you are no longer connected then nohup lets you do just that.

For instance, I use my Raspberry PI to download distributions for review purposes.

I never have my Raspberry PI connected to a display nor do I have a keyboard and mouse connected to it.

I always connect to the Raspberry PI via ssh from a laptop. If I started downloading a large file on the Raspberry PI without using the nohup command then I would have to wait for the download to finish before logging off the ssh session and before shutting down the laptop. If I did this then I may as well have not used the Raspberry PI to download the file at all.

To use nohup all I have to type is nohup followed by the command as follows:

nohup wget http://mirror.is.co.za/mirrors/linuxmint.com/iso//stable/17.1/linuxmint-17.1-cinnamon-64bit.iso &