du -sk
Report the total disk usage for the current directory and all of its
subdirectories.
du -sk *
Report the total disk usage of each file and subdirectory.
quota -v
Report your quota infomation about all mounted file systems with quotas.
(NOTE: Since quotas are set for file systems not directory structures, if a filesystem is mounted more than once by different users, the quota command may report your quota information for the filesystem that other user's directories are on. Just ignore lines with other user's directories.)
Most user accounts have filesystem usage quotas which limit the amount of diskspace a user is allowed to use. There are two ways to enfore quotas, soft quotas and hard quotas. When a user goes over the soft quota, the system returns a warning on the console and the user is given a set period of time to remove enough files to get under the soft quota. If a user goes over the hard quota or the time limit on the soft quota expires, the system will refuse to write to the user's account. Many programs will no longer run, including the Common Desktop Environment. When the Common Desktop Environment refuses to run, a user can still access the account by selecting "Options" from the desktop login screen then choosing either "Command Line Login" or "Session->Failsafe Session"
The command to check your quota and disk usage is: quota -v
It gives results similar to the following:
Disk quotas for jd6789 (uid 3210): Filesystem usage quota limit timeleft files quota limit timeleft /var/mail 16 1000 4000 2 0 0 /home/spring96/ab1234 12376 10000 30000 1 week 120 0 0 /home/spring96/jd6789 12376 10000 30000 1 week 120 0 0
The line of interest has the name of the user's home directory (i.e.: /home/spring96/jd6789). The usage column is the number of kilobytes the user is using. The quota column is the soft quota in kilobytes. The limit column is the hard quota. In this case the user is 2376 kilobytes over the quota and has a week to remove 2376 kilobytes.
The first place to look is the netscape cache directory.
Enter:
du -sk ~/.netscape/cache
If this this is large
compared to your quota, run netscape and goto the the
"Options" menu, select "Network Preferences" and
select "Cache", then set the disk cache to a smaller number
or 0. Then select clear "Disk Cache Now". Turning off disk
caching usually doesn't slow netscape down since since there is still
a memory cache and most home pages are on local machines. This is
usually enough to get under quota. Simply using the
rm command to remove the netscape cache does not work
since next time netscape is used it will begin to fill up the disk
cache again.
If you still need to free up space, change to your home directory
(enter: cd) and enter: du -sk * This
will report the total size in kilobytes of each file and subdirectory
in the current directory. It will not report hidden files and hidden
subdirectories. ls -al or ls -as will report the sizes
of all disk files in the current dirrectory. The number returned by
ls for subdirectories is the size of the subdirectory
index not the total size used by the directory structure. To find the
total size of hidden subdirectories type du -sk
directoryname
Example: du -sk .netscape
.ncftp
All files and directories use atleast one disk sector, so many small files or subdirectories will hog space.
There are many different types of files. Most programs have initialization and data file assocciated with them. There are also backup files and archives.
Initialization files are either in a system directory or in a user's home directory. Most initalization files have names formed by a period followed by the name of the program followed by the letters "rc". For example ".pinerc" is the name of pine's initialization file. Some programs create there own subdirectory structure. For example ".netscape". Except for netscape and users who test a lot of programs. These hidden files don't take up very much space, but if you are really low on disk space, it is usually safe to delete any hidden file that belongs to a program you know that you don't use. Most hidden files are automatically generated with default setting if they don't exist; however, you will lose any customizations you made if you use that program again. The important exceptions being the the files used by X windows, Common Desktop Environment (CDE), Openwindows, and the login shell. Don't delete the following files: ".login", ".cshrc", ".logout", ".mailrc", or ".emacs". Deleting these files will make it difficult to use the system next time you login. If you accidentally destory these files the originals can be found in the directory /etc/skel with the names "k.login", "k.cshrc", "k.logout", "k.mailrc", and "k.emacs". Simply copy the file to your home directory omitting the "k" (example: cp /etc/skel/k.login ~/.login). Other files and directories not to delete are ".Xauthority", ".dt", ".desksetdefaults", and ".openwin-init".
An archives is a file that contains other files. Most archives are compressed. The most common type of archive on UNIX systems are tar archives. Tar archives are often compressed using standard UNIX compress or GNU gzip. UNIX compress files end in ".Z", gzip files endinf ".gz" or sometimes ".z". Uncompressed tar archives end in ".tar"; therefore, a compressed tar archive will end in ".tar.Z" and a gzipped tar archive will end in ".tar.gz" or ".tgz". Gzip uses a better compression algorithm so it is better to gzip files than compress files. Tar files should always be stored gzipped to save space. It is not neccessary to leave an archive in your account once you extracted its contents, except for backup purposes. Another popular archive format is zip. Zip files are compatible with pkzip on MS-DOS; although, MS-DOS has severe filename restrictions. Zip files are (by default) compressed using an algorithm similar to gzip. It is important to note that zip is for compressed zip archives and gzip is a totally different program that compresses individual files. Tar and gzip offer sightly better compression for archives containing many small files, since zip compresses each file separately and gzip compresses the entire tar file.
Many editors create copies of the file being edited. This backup file is invaluable when you make a serious error and save it over you original file. Backup filenames end in "~", "%", ".bak", ".old", or ".older". Different programs use different endings for backup files. Emacs copies the original file into a backup file by with the same name as the original file with a "~" appended. Emacs also periodically saves the file will you are working on, the name of the autosave files are the names of the original enclosed in "#". For example, editing a file named "myprog.c" will create a backup file named "myprog.c~" and autosave file named "#myprog.c#". Autosave files are deleted when you exit emacs normally. Open Windows textedit creates backup files with the extention "%". A file ending in "~~" often indicates that you accidentally edited the backup file without renaming it first. Backup files are safe to remove once you are sure the changes you made are correct.
Another type of large file are core dump files. Core dump files are created when a program exits due to certain errors. All core dump files have the name "core". Core files contain everything the computer knew about a program while it was running. A skilled programmer can use core files to help find errors. To the rest of us, core files just take up a lot of space and are safe to remove. Placing the following line in your .cshrc file will disable most core dumps: limit coredumpsize 0k (NOTE: it is the number zero not the letter "o" before the "k").
Almost every application creates its own data files. It is up to the user to
identify which data files are no longer needed or can be combine with other
files to save space. Files containing graphics, animations, sounds, and movies
are often the biggest hogs of disk space. When low on disk space, cleaning out
your GIF directory for you web page is often a good place to start.