fg
Bring a job to the foreground
Overview
Resumes a job that was suspended (e.g., with Ctrl+Z) or running in the background (e.g., started with &) by bringing it to the foreground. This makes it the current job and attaches it to the terminal input/output.
Syntax
fg [JOB_SPEC]Common Options
[JOB_SPEC]Specifies the job to bring to the foreground. If omitted, the current job (%+) is used.
%nJob number n (e.g., fg %1).
%stringJob whose command line begins with string (e.g., fg %vim).
%?stringJob whose command line contains string.
%+ or %%Explicitly refers to the current job.
%-Refers to the previous job.
Examples
Resumes the most recently suspended or backgrounded job in the foreground.
Brings job number 1 to the foreground.
Brings the most recent job whose command starts with "vim" to the foreground.
Start sleep in background. Then `fg` to bring it to foreground.
Suspend vim. Then `fg` to resume it in the foreground.