Sometimes we will want to stop a process without terminating it.
This is often done to lower the foreground process to move to the background.
So stop a foreground process and place it in the background.
Press control Z.
Actually, let me write that down here.
Control.
Here.
Control.
Plus Z.
Here, so you will want to press Ctrl Z to stop a foreground process and place it in the background.
So let's try it.
And at the command prompt here we will type the X logo.
And here, as you can see, our X logo is opened right here now.
And actually let's make it on the top so we will see what happens.
Right now, always on top.
Let's make it bigger here.
So now let's press the Ctrl Z.
And as you can see here, the we can interact with the bash, but also the logo X logo program is not
terminated.
So after stopping X logo, we can verify that the program has stopped by attempting to resize.
As you can you see here.
Yeah.
It's not behaving as like the previous example, right.
So the program.
Stopped, um, by at when we attempt to resize the logo window.
So we will see that it appears quite dead.
So we can either continue the program execution in the foreground using the FG command.
Or resume the program's execution in the background with the BG command here actually now we will pray
and we will pray another control here.
It's almost suspended here, as you can see here.
It will not print our appropriate X logo right here.
And let's now use the BG here.
And as you can see here, it is also.
Provide from our background here, but now we can also interact when we write here by BG instead of
FG, we can also interact with the Terminal Bash script.
So that's it.
So with the FG command, the job spec is optional if there is only one job.
So moving.
So since we don't have any background job at that time, we didn't need to mention it, but if you do
would want to mention it, you will write background.
Firstly, you will write jobs as we did in previous and here.
Now.
After that you will write BG and your job and as you can see here, job already in background.
So.
Moving a process from the foreground to background is handy if we launch a graphical program from the
command line, but forget to place it in the background by appending the trailing and operator.
So why would we want to launch a graphical program from the command line?
So there are two reasons for that.
The program you want to run might not be listed on the window manager menus such as X logon.
Here.
We don't have x logo, right?
X logo.
We just only have run X logo here, which is this is just a comment that runs like X logo.
But we don't have any additional nexus.
Actually, let me.
Close this previous X logo here.
Here.
We don't have X logo in our program.
So biological program from the command line, you might be able to see error messages that would otherwise
be invisible if the program were launched graphically.
So sometimes a program will fail to start up when launched from a graphical menu by launching it from
the command line.
Instead, you may see an error message that will reveal the problem.
Also, some graphical programs have interesting and useful command line options.