Running Linux scripts in background
By default Linux scripts or applications run in foreground, meaning it is possible to interact with them and see their output.
But there maybe a need to execute these in background . It means this script will be executed, however no output will be displayed to a user.
It maybe useful to launch a long running process in a background and check the status of it once in a while.
Launching a process in background can be done with appending ‘&’ sign after this process.
It is possible to use $! to get id of a process that was executed in background.
Comments
Post a Comment