February 2001
Beginner to intermediate
448 pages
9h 2m
English
Official Description
Runs jobs in the foreground.
Syntax
fg [job_id...]
Options
None
Oddities
The C shell has its own version of fg.
It's useful for jobs that are in the background and need to be brought to the foreground for input processing.
Example
$ cd /tmp $ $ /bin/rm -i *& # Do a rm –I command in the background [1] 4272 $ in/rm: remove 'buzz4'? $ [1] + Stopped (SIGTTIN) /bin/rm -i *& $ $ jobs # Command is stopped and in the background [1] + Stopped (SIGTTIN) /bin/rm -i *& $ $ fg %1 # Bring command to the foreground /bin/rm -i * n /bin/rm: remove 'dentest1'? n # Respond to its needs /bin/rm: diffs: is a directory /bin/rm: remove write-protected file 'difftemp2'? n /bin/rm: remove 'junk'? n (CTRL+C) # Stopped the rm command with a Ctrl+C ...
Read now
Unlock full access