Joonatan Samuel
Joonatan Samuel

Reputation: 651

Foreground a bash command with & at the end

How could one foreground a bash command in Linux terminal such as

sleep 100 &

Upvotes: 2

Views: 1276

Answers (1)

Mureinik
Mureinik

Reputation: 311508

jobs will show you all the running jobs. You can then use the fg %<job number> command to bring a specific job to the foreground. E.g.:

$ sleep 100 &
[1] 19480
$ jobs
[1]+  Running                 sleep 100 &
$ fg %1

Upvotes: 6

Related Questions