In a Linux terminal, the commands bg and fg are used to manage background and foreground jobs.
-
bg: This command is used to resume a suspended job in the background. When you suspend a job (usually withCtrl+Z), you can usebgto continue running it without occupying the terminal.Example:
bg %1This resumes job number 1 in the background.
-
fg: This command brings a background job to the foreground, allowing you to interact with it directly in the terminal.Example:
fg %1This brings job number 1 to the foreground.
You can list jobs using the jobs command to see their status and job numbers.
