Now in our second demonstration,
we're going to take a look at working with the command top.
Now this consolidates output from many commands, including ps, uptime, and free.
So let's go through and work on our command line, encouraging you as
always to follow through on your own system, while we go through and
take a look at this wonderful command.
Some of the commands that I can run in the command line include things
like who, so we can see who is logged into our system.
Can also use the w command.
Now you'll notice the w command gives me a little bit more detailed
information, but also just take a look at that first line.
That command itself is generated, or that line is
generated by the uptime command.
The uptime, as we can see, the current date and time, we've been up 1
day and 22 hours, we've currently got 1 user connected, and we've got
a load average over the last 1 minute, 5 minutes, and 15 minutes.
Now, again, you can see that on our system we haven't really been busy at all.
This is the CPU utilization. Where we have a value of let's say 1.00, we
would be 100% utilized, if we had 1 CPU with 1 core.
Obviously, if I had more cores, or more CPUs, then I can go to a higher value.
So if I've got 4 CPUs, each single cored, I could go
to 4.0 before I was 100% utilized.
When we start looking at the top command,
the top command itself then summarizes the system performance at the top.
So again, I see the output from the uptime command,
I can go through and look at the number of tasks that are running on the
system, so we've got 91 tasks and their process status,
the CPU utilization, and the free memory and the memory that's in use.
Then we're listing all of the running processes, and they're
organized by the process that is taking the most CPU time.
Now that's just the default.
But if I use the key F for fields, I can display the fields.
We can see that I've highlighted the CPU at the moment.
Moving down to %mem, we look at the percentage of memory
being utilized by our processes.
If I want to then sort on that, I can hit S, and then I
can go through and hit Q to quit out.
And we're going to see a far more static display, because the amount of
memory being used by the processes is way more static than the CPU time
they are taking at a particular instance.
If I need to change this back,
I could simply quit out to exit out of the program, or I could go back into
the F to select my fields and change it back, but I'm just going to use Q to
quit. I'll say the top command becomes a very simple way to get a very good feel of how busy the system is currently.