UMBC logo
UMBC High Performance Computing Facility
Checking disk usage
As you conduct your work on the cluster, you will use more and more of your allocated space, and may not always be aware of how the space is being used. Inevitably, free space will run low and you will need to do some cleanup. On this page we will provide some help to identify how your space is being used.

One very important place to keep an eye on is your home directory. Many programs use space in your home directory to store preferences, settings, etc. If you don't check occasionally, you may not be aware of how much space is being used this way. Also, if you run out of space in your home, you may begin to get mysterious errors which do not appear to be related to disk space. For example, users often see "X11 connection rejected because of wrong authentication" when trying to run X Windows programs remotely.

Before reading this page, make sure to read Using your account so that you know the location of your storage areas, and how to basic checks of quotas and partition sizes.

"topdu" script

We have provided a script called "topdu" which computes the top N largest files / sub-directories in a given directory. This can help you quickly identify where your space is being used the most. To run the script, simply enter the command
[araim1@tara-fe1 ~]$ topdu
If we run the command without arguments, it will give us the top 10 largest files and directories in our current working directory. Notice that the units are in KB. Let's run this in our home
[araim1@tara-fe1 ~]$ topdu
(May take some time to compute space usage)
The 10 largest files or directories (in KB) under /home/araim1/
24080	/home/araim1/.idl
14812	/home/araim1/userEstimates.txt
6448	/home/araim1/texmf.bak.tar.gz
4252	/home/araim1/beamer-3-10.tar
4244	/home/araim1/tmp
3928	/home/araim1/r-workshop
3220	/home/araim1/.matlab
2220	/home/araim1/beamer
1448	/home/araim1/out.pdf
1332	/home/araim1/2669851.pdf
It's easy to see that the IDL program is using the most space in home in the output above, at about 24 MB. We can also check other directories besides the current working directory, and also optionally request a different number than top 10. We can also suppress the text at the beginning, to use the output in other scripts (for example). To see all the available options
[araim1@tara-fe1 ~]$ topdu -h
Usage: topdu [-n <TOPN>] [-q] [<DIRNAME1>] [<DIRNAME2>] ...
	Display the TOPN largest files in DIRNAME1, ... DIRNAMEk
	Default TOPN is 10
	If no DIRNAMEs specified, default is to use current working directory
	-q suppresses any extra output
Here's an example using some of the options
[araim1@tara-fe1 ~]$ topdu -n 5 -q ~/ ~/nagaraj_user/
24080	/home/araim1/.idl
14812	/home/araim1/userEstimates.txt
6448	/home/araim1/texmf.bak.tar.gz
4252	/home/araim1/beamer-3-10.tar
4244	/home/araim1/tmp
207119	/home/araim1/nagaraj_user/work
170720	/home/araim1/nagaraj_user/doc
129705	/home/araim1/nagaraj_user/petsc-2.3.3-p15
112629	/home/araim1/nagaraj_user/mpich2
109396	/home/araim1/nagaraj_user/project
We can also set up a BASH alias if we'd like, for quick use of a frequently used command
[araim1@tara-fe1 ~]$ alias top15='topdu -n 5 /home/araim1'
[araim1@tara-fe1 ~]$ top15
(May take some time to compute space usage)
The 15 largest files or directories (in KB) under /home/araim1/
24080	/home/araim1/.idl
14812	/home/araim1/userEstimates.txt
6448	/home/araim1/texmf.bak.tar.gz
4252	/home/araim1/beamer-3-10.tar
4244	/home/araim1/tmp