Running Process in Background on Linux

Adding & the end of the command

On Linux/Unix based systems you can put a task (such as command or script) in a background by appending a & at the end of the command line. In other words, you can say that easily send any process in the background.

Syntax:
# command &
# script-name &

# find / -name *.c > /root/output.txt &

Using & with nohup
You can use nohup command line-utility which allows to run command/process or shell script that can continue running in the background after you log out from a shell:

Syntax:
# nohup command-name &
# nohup find / -size +1k > /root/output.txt &

 

Leave a Reply

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