Skip to content

Latest commit

 

History

History
25 lines (16 loc) · 518 Bytes

run-commands-in-the-background.md

File metadata and controls

25 lines (16 loc) · 518 Bytes

Run Commands In The Background

Category: Linux

Linux or macOS can run commands in the background using the & symbol after the command. You can use this for commands that are long running.

For example, to run top in the background:

top &

List background commands showing the job and process id using the jobs -l command.

jobs -l

[1]+ 31872 Stopped (tty output): 22top

Bring the command back to the foreground use the fg command with the id of the job.

fg 1