So, my roommate was hunting for a large file/directory on his linux box today, and the way do to it is rather non-obvious.
You want to us the du or disk usage command. If you just use the command, you'll get a recursive list of directories and their sized, probably not what you want. If you want the size of the directory you are in, try du -sh - it'll simply print the size of all the files in the current directory.
More useful, however, is to list the subdirectories, and how big they are. For this, you want the --max-depth= option. The -s option is summarize, it's equivalent to --max-depth=0. Try max depth of 1 or 2, or even higher if you need.
Here is a sample from my computer:
user@computer:~/Videos$ du -sh
73G .
So the Videos folder in my home directory has 73GB worth of files in it. Alright, let's see more:
user@computer:~/Videos$ du -h --max-depth=1
21G ./Movies
53G ./TV Shows
73G .
Well, apparently I have 21GB in the Movies directory and 53GB in the TV Shows directory. Let's see a little more.
user@computer:~/Videos$ du -h --max-depth=2
6.6G ./Movies/Forgetting Sarah Marshall
4.4G ./Movies/Get Smart
4.4G ./Movies/How To Lose Friends And Alienate People
4.5G ./Movies/WALL-E
701M ./Movies/Zach and Miri
21G ./Movies
6.3G ./TV Shows/Big Bang Theory
15G ./TV Shows/Chuck
14G ./TV Shows/Get Smart
19G ./TV Shows/The Office
53G ./TV Shows
73G .
There you go, now you know what movies and tv show's I've got on my computer. Of course, it's all legal backups of stuff I own ;)
Tuesday, July 28, 2009
Subscribe to:
Post Comments (Atom)
Nice :-)
ReplyDelete