Run­ning a task in the back­ground while ex­it­ing the con­sole

OpenSource For You - - TIPS & TRICKS - —Yogin­dar Das Y, yogin­[email protected]­hoo.com

Some­times you may have to run a script in the back­ground but may want to exit the con­sole be­fore it fin­ishes. If you quit the con­sole, your task also quits as it is a child process. The best way to solve this is­sue is to use the no­hup com­mand. Given be­low is the syn­tax to do so:

# no­hup <com­mand> &

Here is an ex­am­ple:

# no­hup ping www.ya­hoo.com &

[1] 5556

# no­hup: ap­pend­ing out­put to `no­hup.out’ You can exit the con­sole now, and later log in and open the no­hup.out file to see the out­put of the com­mand.

Newspapers in English

Newspapers from India

© PressReader. All rights reserved.