About disk quota in Unix

A disk quota is the amount of space allotted to each user for file storage on a given computer.

On shared systems such as Unix, every user has a maximum disk quota. This prevents any individual from using more than his or her fair share of disk space. In order to keep from going over your quota, you must be sure to periodically clean out old, unused, and unneeded files.

Two commands are very helpful in bringing your disk space back under control:

  • The ls -al command shows you the contents of your directory.
  • The rm command removes any unnecessary files.

To use the rm command (which stands for "remove"), enter:

 rm filename

Replace filename with the name of the file you want to remove.

You can also enter:

 rm -i filename

The -i flag tells Unix to inquire for confirmation before removing.

Always be careful when you remove files, because there is no command to retrieve the file. You may create an alias that will move files to a trash can rather than removing them from the system completely, but this is generally not an accepted practice.

If you are unsure of the content of a file, enter:

 cat filename

Replace filename with the name of your file. If it is a text file, the cat command will print the contents of the file to the screen. If it is a binary file, cat will print screen after screen of garbage characters. If you are unsure of the type of file, you may prefer to use the more command, which will show only one screen of the file at a time and will allow you to cancel the command easily. To use the more command, enter:

 more filename

Replace filename with the name of your file.

The following items can usually be discarded:

  • Any file named core, which is a file created when certain programs crash
  • Temporary files which have names that begin and end with #
  • Backup files which have names that end with ~
  • Backup files which have names that end with %

Also, discard any personal files that are obsolete or no longer needed.

Don't forget to check all of your directories and subdirectories. Directories are the items that begin with "d" in the first column when you issue the ls -al command.

For example, to check the subdirectory galactica, enter the following commands:

 cd galactica ls -al rm filename1 filename2 filename3 cd

At Indiana University, for personal or departmental Linux or Unix systems support, see Get help for Linux or Unix at IU.

This is document acwz in the Knowledge Base.
Last modified on 2019-08-27 08:51:55.