Moving Jobs to the Background or Foreground with bg and fg

The shell has the concept of “foreground” jobs and “background” jobs. Foreground jobs are process groups with control of the terminal, and background jobs are process groups without control of the terminal.

Let’s say you started a job by running a program at the command line. Maybe something like this, which could take a while to run:

matthew@seymour:~$ find . -type f -printf "%s\t%p\n" | sort -n

When you run this, it starts in the foreground, meaning the terminal will be interactive with you only for this job until the job is complete. This particular job will find all files in the current directory and its subdirectories and then list them according to ...

Get Ubuntu Unleashed 2015 Edition: Covering 14.10 and 15.04, Tenth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.