Space usage in MB or GB

hi,
In HP unix, how can check the space usage in Mb
bdf will give me the output in Bytes i guess.

Also, how can i check the directory size in hp unix.

Thx

I usually use "du -sk head_dir" or similar options. Comes in K, sorry.

By directory size, do you mean inode size (ls -ld) or space usage (above)? Big directory inodes can slow a system, say from the accidental creation of many files now deleted. Every file search miss reads the whole thing. This can be real bad on dynamic link paths and $PATH. I have never heard of a utility to fix this -- probably fixed on some new fangled file systems. Generally, you have to make a new directory and rename. You can hard link files during the transition, but not directories, of course. You might sym link directories, and then after parent rename, mv them over, deleting the sym link in the way. Think system down time.

If you want usage by group or user, that is a whole tree find and sum that du might not do for you, but who knows, check your du man page. It is good to see what the handling of hard and sym lnks is in these calc, too. Make sure there are no black holes to lock a find / on your system.

Really, usage is in blocks (multiply/divide from there).

The output from "bdf" is in kilobytes.
Can you give an example?

take the output of bdf and divide by 1024

You can use following code to check size of all directories and sub-directories :

 
find . -type d | xargs du -sk
1 Like