Next: What's in the File?
Up: Powerful Little Programs
Previous: Operating on Files
Commands in this section will display statistics about the operating
system, or a part of the operating system.
du [-abs] [path1 path2 ...pathN]
du stands for disk usage. It will count the amount
of disk space a given directory and all its subdirectories take
up on the disk. du by itself will return a list of how much
space every subdirectory of the current directory consumes, and, at
the very bottom, how much space the current directory (plus all the
previously counted subdirectories) use. If you give it an option
parameter or two, it will count the amount of space used by those
files or directories instead of the current one.
The a flag will display a count for files, as well as
directories. An option of b will display, instead of kilobytes
(1024 characters), the total in bytes. One byte is the equivalent of
one letter in a text document. And the s flag will just display
the directories mentioned on the command-line and not their
subdirectories.
df
df is short for something, although this author isn't quite sure
what. df summarizes the amount of disk
space in use. For each filesystem (remember, different filesystems are
either on different drives or partitions) it shows the total amount of
disk space, the amount used, the amount available, and the total
capacity of the filesystem that's used.
One odd thing you might encounter is that it's possible for the
capacity to go over 100%, or the used plus the available not to equal
the total. This is because Unix reserves some space on each
filesystem only for root. That way, if a user accidentally fills
the disk, the system will still have a little room to keep on
operating.
For most people, df doesn't have any useful options.
uptime
The uptime program does exactly what one would suspect. It
prints the amount of time the system has been ``up''--the amount of
time from the last Unix boot.
uptime also gives the current time and the load
average. The load average is the average number of
jobs waiting to run in a certain time period. uptime displays
the load average for the last minute, five minutes, and ten minutes.
A load average near zero indicates the system has been relatively
idle. A load average near one indicates that the system has been
almost fully utilized but nowhere near overtaxed. High load averages
are the result of several programs being run simultaneously.
Amazingly, uptime is one of the few Unix programs that have
no options!
who
who displays the current users of the system and when they
logged in. If given the parameters am i (as in: who am i),
it displays the current user.
w [-f] [username]
The w program displays the current users of the system and what
they're doing. (It basically combines the functionality of
uptime and who. The header of
w is exactly the same as uptime, and each line shows a
user, when the logged on (and how long they've been idle). JCPU
is the total amount of CPU time used by that user, while PCPU
the the total amount of CPU time used by their present task.
If w is given the option f, it shows the remote system
they logged in from, if any. The optional parameter restricts w
to showing only the named user.
Next: What's in the File?
Up: Powerful Little Programs
Previous: Operating on Files
Converted on:
Mon Apr 1 08:59:56 EST 1996
|