From the course: Complete Guide to Navigating Linux: Working with Users, Files, and Networks
Unlock this course with a free trial
Join today to access over 24,900 courses taught by industry experts.
Background and foreground jobs - Linux Tutorial
From the course: Complete Guide to Navigating Linux: Working with Users, Files, and Networks
Background and foreground jobs
- While working with processes, it's also good if you know how to work with background and foreground jobs. First, what is a job? Well, a job is a process that is started interactively by a user from a shell. So, any comment that you are running is a job, and by default, jobs are started in the foreground. And if you want to start a job in the background, simply put an ampersand behind the command name. Alternatively, on our running job, you can use Control-Z to stop the current job, and bg to continue running this job in the background. The job's commands will list currently running jobs, and fg is used to move a job from the background to the foreground. Let's do a quick demo. So, when I use sleep 3600 to do nothing for an hour, then, well, it will do nothing for an hour. And if I would like, I can watch the blinking cursor, and if I don't, then I'm using Control-Z to temporarily stop it, and then I can use bg to continue running it in the background. I can also do that immediately…
Contents
-
-
-
-
(Locked)
Learning objectives37s
-
(Locked)
Working as administrator6m 36s
-
(Locked)
Linux users and groups4m 31s
-
File permissions and ownership7m 4s
-
(Locked)
Managing processes9m 5s
-
(Locked)
Starting processes automatically3m 32s
-
(Locked)
Background and foreground jobs1m 40s
-
(Locked)
Command overview1m 48s
-
(Locked)
Lesson 2 lab: Managing users and processes42s
-
(Locked)
Lesson 2 lab solution: Managing users and processes2m 55s
-
(Locked)
-
-
-