At IU, in Unix, how can I make better use of my disk space?

On this page:

To effectively manage your disk space at Indiana University, you need first to determine the size of your disk space and how much of it you have used. On a Unix computer, to see how much disk space you are using and how much you are allowed to use, from the Unix shell prompt, enter:


To see how much space each file on your account takes, enter:

 ls -alR ~/

The command above shows a listing of all files in your account, including those in subdirectories. If you have many files and subdirectories, the output may be very long. To read it in page-sized chunks, use the pipe command to format it:

 ls -alR ~/ | more

See the following examples for ways to maximize storage on your Unix account without a space increase.

Delete backup and temporary files

Delete backup and temporary files of the form filename~ and #filename# by entering:

 rm *~ rm \#*
With some shells, you need to escape the # (pound sign) character with a \ (backslash) character, since otherwise the shell would treat the rest of the line as a comment.

Store temporary files elsewhere

Put temporary files in the directories /tmp, /scratch/username/, or /scr/username/ while you are using them (where username is your username).

Some systems may not have /scr or /scratch directories, or you may have to create your own subdirectory in /scr or /scratch. Files in these directories are periodically erased and are not counted against your space. For information about scratch space on IU's research systems, see On IU's research systems, how much allocated and short-term storage capacity is available to me?

Compress files

Compress files using one of several Unix compression programs. To compress a file named bigstuff with the Unix gzip command, at the Unix prompt, enter:

 gzip bigstuff

The file will be replaced in your directory with a compressed file that has a .gz extension. You can't read files or run programs while they are in compressed format, so this command is most useful for storing things you want to keep but won't need to use soon. To expand the file back to its original state, enter:

 gzip -d bigstuff.gz

For more information about Unix compression utilities, see the online manual pages. At the Unix prompt, enter any of the following:

 man gzip man tar man zip man compress

Store unused files elsewhere

Download some of the files you are not using to a Windows or Macintosh computer and save them on the hard drive or a removable disk.

At Indiana University, for personal or departmental Linux or Unix systems support, see At IU, how do I get support for Linux or Unix?

This is document aeel in the Knowledge Base.
Last modified on 2017-08-14 14:33:02.

  • Fill out this form to submit your issue to the UITS Support Center.
  • Please note that you must be affiliated with Indiana University to receive support.
  • All fields are required.

Please provide your IU email address. If you currently have a problem receiving email at your IU account, enter an alternate email address.

  • Fill out this form to submit your comment to the IU Knowledge Base.
  • If you are affiliated with Indiana University and need help with a computing problem, please use the I need help with a computing problem section above, or contact your campus Support Center.

Please provide your IU email address. If you currently have a problem receiving email at your IU account, enter an alternate email address.