Funny UNIX command question!!!

pwharff

Registered
I'm pretty proficient when it comes to UNIX but today I wanted to find out the size of a folder and it's contents and I realized that I didn't know how to do this. I know of the 'ls -s' command that is only for files. Someone please help, I know it's silly and probably really simple.
 
I believe you are looking for du:
Code:
$ du -sk Desktop/
74844   Desktop/
so my Desktop is currently around 74 megs (I sure need to clean that...).
You can look at individual folders in a path as well, by omitting the s flag; the k tells it to show kilobytes, otherwise it will show you the amount in blocks (512 bytes).
 
I realized how to do just this as soon as you posted this!!! Brainfart! Anyway, if you think your desktop is huge in size, look at mine:

du -sk Desktop/
11727536 Desktop/

WOW, 11gb!!! Anyone have more on their desktop?
 
It also depends on how many files you have on your desktop. One 11GB file is a lot cleaner than 100,000 small files...

Not at home right now, but this (work) desktop du is 0. I like a clean desktop, so my home desktop will probably be similar...
 
du -sk Desktop/
32 Desktop/

M'heh.

I keep my desktop icons huge-ass so it gets ugly quickly if I put too much stuff on there.

-the valrus
 
Back
Top