Categories
Linux

Detach script/command in Linux – Easy Way !

Hot to start and detach bash script (or command) in linux from the command line:

setsid nohup monitor.sh &

detach script/command with custom log:

setsid nohup monitor.sh &>/tmp/monitor.log &

And to check the result, use a linux command that shows the process hierarchy:

[email protected]:/usr/local/bin# ps -efj --forest

Linux command that shows the process hierarchy

Leave a Reply

Your email address will not be published. Required fields are marked *