Linux and Unix fg command

Quick links

About fg
Syntax
Examples
Related commands
Linux and Unix main page

About fg

In Linux, UNIX and any other POSIX-compliant operating system, the fg command continues a stopped job by running it in the foreground.

Syntax

fg [ %job_id ]

Options

%job_id Specifies the job that you want to run in the foreground.

Examples

fg

Typing fg will resume the most recently suspended or backgrounded job.

fg 1

Brings the job with the id 1 into the foreground, resuming it if it was suspended.

Related commands

bg — Resume a suspended program without bringing it to the foreground.
csh — The C shell command interpreter.
kill — Send a signal to a process, affecting its behavior or killing it.
ksh — The Korn shell command interpreter.
ps — Report the status of a process or processes.
sh — The Bourne shell command interpreter.
stop — Stop a running job.