Linux : Detach command from Shell

So you have executed a command that is taking time, and you are fearing that if someone closes your shell program ( e.g. putty ), your command will stop?

Not to worry, do as intructed below:

1. Run command ( e.g. tar -xvf myfile.tar )
2. Press ctrl + z  ( This will pause the command )
3. Type "bg"  ( This will send the program to background )
4. Type " disown -h" ( This will  Detach command from Shell )

Now you can close your shell, but your command will remain running.


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Note : For checking, login on server with another shell, and grep your command:

ps -ef | grep tar

Comments