[Intro Music]
Let me now briefly summarize what
we did during previous few
lectures. First we have used
apt-get utility in order to
install missing htop package. This
package is missing in this Ubuntu
image that we are running using
Docker. We have actually used the apt-
get before in order to install other
package called 'mandb' in order to
get the man pages working in Linux
computer. I have also shown you how
to run htop utility, and how to get
information about the currently
running processes. You could also
perform other actions with those
processes like kill processes and
filter them if you want. Also
using htop utility, you could
observe how much CPU and memory are
currently used by all running
processes. And I see that CPU
consumption is around 2%, and
memory consumption is around 300
megabytes. Also, I see here limit
2.92 gigabytes. And actually
it is a limit of Docker Host. I
could go to Docker Settings and
quickly demonstrate it. Go to
Dashboard, click on Settings icon,
go to Resources, and here is this
memory limit, 3 gigabytes. And
here is also Swap size, 1
gigabyte. And you actually see this
limit here in this table as well.
It means that this Docker container
is able to utilize up to three
gigabytes of RAM and up to one
gigabyte of swap size. Great. But
the main idea why I wanted to show
you this htop utility is that it
actually shows out of the box
command that was used for start of
corresponding process. Actually,
you could use additional option
along with 'ps' command. Let me show
you this quickly; 'ps -f';
and with this option, you could
also see command that was used for
start of corresponding process. For
example, I have just entered 'ps
-f' command, that's why here in
this list, I see 'ps' along with
'-f' option. Great. That is how you
could use ps, top and htop utility.
Now let me do for you quick demo
and run htop utility on another
Ubuntu computer that has much more
processes than this container. Let
me switch there, and enter 'htop'
here. It is available here out of
the box. And here's a long list of
different processes. And you may
see that some of processes were
started by root user and some by
bogdan user. Actually, you could
run htop utility along with option
that will filter processes by user.
Let me quickly show you that, 'htop
--help'; and here you will
see this option '-u', it is
short version of this option, or
long version is '--user'. And
if you use this option, you need to
supply mandatory argument for this
option. Recap that we have talked
about arguments for options before.
And for example, if I want to list
only my processes, I could use this
option, 'htop -u'; and if I
use short version of option, I need
to supply argument for option after
space like so, '-u ', and
type my name. And now I see only my
processes here in this table. Let
me exit from here. And let's list
all processes that were started by
root user; and let me use long
version of this option, '--user';
and in such case, I need
to use here equal sign and type
name of the user 'root', like so, press
Enter, and now I see processes that
were started only by 'root' user. All
right, let me exit from here. And
let me start htop without any
additional options like this. And
let me show you how you could
perform for example, filtering of
processes. For that you could press
F4; and let's filter for
example by 'bash'; and now I will
find 'bash' process that was started
by 'bogdan' user. Also let's
filter for example by 'gnome', like
so. And now I will see all
processes that have 'gnome'
somewhere in the process name.
Alright, that's how you could filter
processes. Now let me
demonstrate to you how to sort
processes. For that you
could use F6. Let me press it. And
here in the left section, you could
sort for example by PERCENT_MEM;
and now I see that all processes
were sorted by percentage of memory
usage. And here is the process that
utilizes around 6% of memory. It is
actually this graphical user
interface desktop I am currently
working in, nautilus-desktop. Okay.
Also you see limits of this
computer. And now one gigabyte of
RAM is utilized and the maximum
size is two gigabytes. And actually
I'm running this Ubuntu computer as
virtual machine using VMware Fusion,
and I have set the limit of two
gigabytes of RAM for this computer.
That's why here I see this limit,
two gigabytes. Alright, that's all
for this demonstration. And please
note that if you don't have
separate Ubuntu computer, no
worries, you are still good to go
just with Linux container running
using Docker. That's all for those
lectures about processes. I hope
you enjoyed them. And next let me
talk about the standard in - stdin, standard
out - stdout, and standard error - stderr of every
process. You'll understand those
three different data flows of every
process, and you'll understand how
to use them. I will see you guys in
the next lecture. Bye-Bye.
[no audio]