Commands covered in this section: date wc who ps du quota

Date & Time

To find what the date and current time are, simply type date. This will give you the date and time in a format similar to this Thu Aug 13 13:50:33 EDT 1996. If the system is set to display GMT then this is what you will get, otherwise you can force date to display GMT by using date -u, which will produce your output in GMT.

File Lengths

The wc command will enable you to find out how many words, lines or characters are in a text file. This is a useful command if you have some work which is restricted in length, or simply find out how long you latest master piece is!
wc filename will give you the number of characters, words, and lines in the file. If you don't want all these details you can restrict the output by using: wc -c filename to get the number of characters in the file only, wc -w filenameto get only the number of words in the file, wc -l filename to get the number of lines, or you can use any combination of these.

Space Used

One thing you are bound to notice at some point, is that you do not (most often) have unlimited space on your account. Each file/directory you create will take up some of your file and disk quota. Monitoring how much disk space you are using is an essential part of your UNIX life. There are two commands you can use to do this, namely du and quota.


du will report how many disk blocks your files and directories are using. Use du to find out the space taken up by the files in your current directory as well as any sub-directores immediately beneath the current.
If you use du name1, name2, ... you will get the amount of space taken up by the files/directories you specified. The output of du can be formatted, to make reading it easier. Use du -a to force du to display details of each file on a separate line, or use du -s to give you details of how much space the entire directory is using, not displaying each the details for each file.

Another way to find out how much space you have left is to use quota. This command will tell you how much of your quota you are using and what your limit is.


quota on its own will tell you how much space has been allocated to your account and how much you are using. quota -v will display quota on file systems where there is no storage. quota -g will tell you how much quota you are using as well as the group to which you belong, if you want more details use quota -q.
To get another user's quota information use quota username. Or you can use quota groupname to get the quotas for a given group.

< Previous: Editing and Printing Files ^ Next: Making It Easier >

Frankie Blaskovic
Last modified: Sun Aug 10 11:53:37 BST 1997