Give an example use of the nohup command
the nohup command is used to detach a command from the terminal's lifespan
when you launch a program from a terminal, the program is bonded to the terminal. this means that if you close the terminal, the program closes too.
nohup avoids this behaviour, allowing you to launch a program and then close the terminal
for example, if you want to run a program as a daemon in the background you could do it like this
nohup ./program &
where the ampersand is used to put the program in the background
so like if a script throws a error you can use it to log the error.
so like hohup script.pl
i guess that he's referring to the fact that the output of the program gets redirected to a file called "nohup.out" in the current directory
that's just a side effect, if you want to redirect the output you can just redirect stdout using the ">" operator
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now