How to run Linux commands in background even when you logout?
Ans : In Linux/nix by default we cant run the commands in background when we logged. When we try to logout form terminal you will get following error.
There are stopped jobs.
Supose you have logged in to a remote system by using ssh, after starting a script there you thought of logging out from that terminal but the script is still running. At this point we want to run the script even we loggedout.
What we can do is to run a process background though you have logged out ?
This can be achived by using the nohup command. Below is the man help for nohup.
No Hang Up. Run a command immune to hangups, runs the given command with hangup signals ignored, so that the command can continue running in the background after you have logged out.
nohup Command [Arg] &
nohup ping google.com &
Latest posts by Surendra Anne (see all)
- Review: Whizlabs Practice Tests for AWS Certified Solutions Architect Professional (CSAP) - August 27, 2018
- How to use ohai/chef-shell to get node attributes - July 19, 2018
- wget download a file to a directory in Linux/Unix - June 4, 2018
- GIT: How to compare two GIT branches? - June 3, 2018
- Online training on Linux Bash shell scripting - February 8, 2018