fg Linux Commands
What is Linux fg Command?
Explanation
fg COMMAND:fg command is used to place a job in foreground.
SYNTAX :
fg [specify job]
OPTIONS:
There is no options for fg command.
EXAMPLE:
- To move a process in foreground:
Lets start some three jobs and suspend those running process in background.
kmail- start the email client application.
Press ctrl+z to stop the current job.
xmms- music player application.
Press ctrl+z to stop the current job.
sleep 120- a dummy job.
Press ctrl+z to stop the current job.
jobs
The above command will display the jobs in the shell.
[1]
Stopped
kmail
[2]- Stopped
xmms
[3]+ Stopped
sleep 120
fg 1
The above command will run the kmail application process in foreground.