Click to See Complete Forum and Search --> : how much space is directory and files taking up?


brasso
04-04-2001, 10:37 AM
I tried to find a Linux function that would tell me the blocks taken up by a directory full of files. I thought sure that Linux with its complicated functions could do this. I figured ls in some form would do it, but I can't see how.

This is somethine I always wanted from DOS, but never got, until I got 4DOS, where you can go: dir /u.
Anybody know the secret phrase that'll get me what I want?
Earl

drmbb
04-04-2001, 10:51 AM
The "df" command will give info on file system usage, while "du" will give you info on individual directories

e.g. du /dir or du -s /dir if you just want total blocks occupied (and -i will report idnodes instead of blocks, -h will report Mb/Gb instead of blocks).

Should be man pages on both these too.

ph34r
04-04-2001, 02:30 PM
I like


du -sh /path/to/directory


myself...

bdg1983
04-04-2001, 04:13 PM
Those commands are also listed in the 'Basic Commands' NHF here at LNO.

Good place to start. Then as suggested, you can use the man pages for further details.