I use the command $ nohup ...
to start an application in the background so that I can close the terminal window afterwards.
Upon execution it creates the file ~/nohup.out
.
Example:
orschiro@x230:~$ nohup /bin/bash -c "sleep 15 && python3 /home/orschiro/bin/show_state.py"
nohup: ignoring input and appending output to 'nohup.out'
How can I prevent nohup
from creating nohup.out
?
You may redirect the output anywhere you like, for example:
redirection prevents the default output file
nohup.out
from being created./dev/null
is oblivion, so if you don't want the data at all, send it there.In bash you can abbreviate
>/dev/null 2>&1
to&>/dev/null
For programs I use often I make an alias (and add it to my
.bashrc
) for exampleNow all I have to type is
show_state