9to6linux.com
Covering latest Linux News, Tutorials, Reviews and more

How to Run Linux Shell Command / Script in Background

In this guide, we will learn how you can run Linux shell command or script in the background. - Community submission by Editor (9to6linux) on

How to Run Linux Shell Command / Script in Background

How to Run Linux Shell Command / Script in Background

In this guide, we will learn how you can run Linux shell command or script in the background.

The usual style of executing a command on a Linux terminal is to simply run it and wait for it to gracefully exit. Once the command exits, you can then proceed to execute other commands in succession. This is what is known as running commands in the foreground. As the word suggests, you can visually see the output of the command on the terminal.

Sometimes, however, running commands in the foreground can present a set of challenges. The command can take too long to exit causing you to waste precious time and other times, it can be totally attached to the shell session leaving you stuck.

In such cases, running a command in the background is your best bet. You can send a command(s) to the background as you concurrently execute other commands in the foreground. This improves the efficiency of working on the terminal and saves you time.

In this guide, we focus on how you can run Linux shell command or script in the background.