Languages
[Edit]
EN

Bash - work with multiple tasks

6 points
Created by:
martineau
1350

In this article, we would like to show you how to work with multiple tasks in Bash.

Preview:

Example how to switch between multiple tasks in Bash.
Example how to switch between multiple tasks in Bash.

Simple steps:

1. run some command e.g. that blocks console:

Hint: to run the command directly in the background add & at the end, e.g. sleep 60 &.

 

2. press Ctrl+Z to put command to the background (detaching)

Hint: now you can run more different commands and press Ctrl+Z

 

3. to display background jobs run the following command:

Where -l is optional and means list.

Example output:

 

4. to stop the process use the following command:

e.g:

 

5. to bring the process back to the terminal (attaching) run the following command:

e.g:

 

Alternative titles

  1. Bash - work with multiple commands
  2. Bash - work with multiple jobs
  3. Bash - multitasking
  4. Bash - run command in background
  5. Bash - run process in background
  6. Bash - work with multiple tasks and put them to the background
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join