Space usage in MB or GB


 
Thread Tools Search this Thread
Operating Systems HP-UX Space usage in MB or GB
# 1  
Old 08-03-2011
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
This User Gave Thanks to bang_dba For This Post:
# 2  
Old 08-03-2011
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).
This User Gave Thanks to DGPickett For This Post:
# 3  
Old 08-03-2011
The output from "bdf" is in kilobytes.
Can you give an example?
This User Gave Thanks to methyl For This Post:
# 4  
Old 08-03-2011
Quote:
Originally Posted by bang_dba
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
take the output of bdf and divide by 1024
This User Gave Thanks to frank_rizzo For This Post:
# 5  
Old 10-11-2011
You can use following code to check size of all directories and sub-directories :

Code:
 
find . -type d | xargs du -sk

This User Gave Thanks to dinesh1178 For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with script to display space usage

Hi all, I am looking for help with a script for displaying the space available from a df - h command for / (root). The problem is: If it is below 700 MB I have jobs that are failing... Is there a way I can do a calculation? If it above 700 MB it is good, if it is below 700 MB it will fail.... (5 Replies)
Discussion started by: gartie
5 Replies

2. Red Hat

Phantom space usage in /

Hi everyone, Got an interesting one (well, interesting to me) I have a box with a 5Gb / mount point. Checking for large files I found nothing and in fact when I did a full du I found that there was only 1.6Gb in use! And yet 100% used in / So there's an unaccounted 3.4Gb somewhere! The... (3 Replies)
Discussion started by: keefbaker
3 Replies

3. AIX

FS space usage

Hello. I have a clean-up script that deletes > 5days old files on /archive/idocs directory. This script runs twice a week, Tuesday and Friday. This creates a log file that shows the current space usage before and after the files were deleted from the directory. On Feb 3, the script ran and... (2 Replies)
Discussion started by: udelalv
2 Replies

4. UNIX for Dummies Questions & Answers

Command to display the space usage (memory usage) of a specific directory.

Hi all, Can you please tell me the command, with which one can know the amount of space a specific directory has used. df -k . ---> Displays, the amount of space allocated, and used for a directory. du -k <dir name> - gives me the memory used of all the files inside <dir> But i... (2 Replies)
Discussion started by: abhisheksunkari
2 Replies

5. UNIX Desktop Questions & Answers

Issue with disk space usage

Issue with disk space usage I have the following line in my "df -h" output: Filesystem Size Used Avail Capacity Mounted on /dev/ad4s1a 496M 495M -39M 109% / What is the issue with having 9% excess utilisation? How can I find out what this partition is... (2 Replies)
Discussion started by: figaro
2 Replies

6. Shell Programming and Scripting

Disk Usage - Space Used

Hi all, FreeBSD7.1 @ sh. In a backup script I am trying to get the blocks used by the backup once completed. I am using the function: #!/bin/sh spaceused() { du -d 0 "${1}" | awk -F"+" '{ print $1 } } to return the blocks used of said directory and contents. Via. command line... (7 Replies)
Discussion started by: Festus Hagen
7 Replies

7. HP-UX

how can I find cpu usage memory usage swap usage and logical volume usage

how can I find cpu usage memory usage swap usage and I want to know CPU usage above X% and contiue Y times and memory usage above X % and contiue Y times my final destination is monitor process logical volume usage above X % and number of Logical voluage above can I not to... (3 Replies)
Discussion started by: alert0919
3 Replies

8. UNIX for Dummies Questions & Answers

how to determine the disk space usage

how can we determine the disk space used by a certain directory? (1 Reply)
Discussion started by: gfhgfnhhn
1 Replies

9. UNIX for Dummies Questions & Answers

finding disk space usage

How would I go about finding the about of disk space occupied by a certain directory? For example, /u1/cvera => 530 MB Thanks =) (3 Replies)
Discussion started by: cvera8
3 Replies

10. UNIX for Dummies Questions & Answers

formatting space usage/available reports

I'm really, really new to writing scripts, but have been asked to generate a report that will show available space for a disk, space used by particular subdirectories on the disk and totals. I can get the information I need with du and df and output it to a text file but I'm stumped as to how to... (3 Replies)
Discussion started by: DesperateDBA
3 Replies
Login or Register to Ask a Question