fbpx

BASH: Run tasks in the background

January 24, 2012

Run tasks in the background

bash lets you runone or more tasks in the background, and selectively suspend or resume any ofthe current tasks (or “jobs”). To run a task in the background, addan ampersand (&) to the end of its command line. Here’s an example:
bash> tail -f /var/log/messages &
[1] 614
Eachtask back-grounded in this manner in assigned a job ID, which is printed to theconsole. A task can be brought back to the foreground with the command fgjobnumber, where jobnumber is the job IDof the task you wish to bring to the foreground. Here’s an example:
bash> fg 1Alist of active jobs can be obtained at any time by typing jobs at the bash prompt.

avatar
Gonzalo Escribano

Ver entradas

Most Recent

June 9, 2022

¿Qué son las DAO y cuáles son sus beneficios?

Es común en la historia contemporánea que haya cambios a partir de los avances en el campo de la...

Read More

June 2, 2022

¿Qué son las DeFi y por qué son el futuro de las finanzas?

Es común en la historia contemporánea que haya cambios a partir de los avances en el campo de la...

Read More

May 27, 2022

How to start a successful product build from scratch?

Creating a product from scratch could be a huge challenge. To achieve your business goals it’s important to develop...

Read More