Command for cumulative disk space

 
Thread Tools Search this Thread
Operating Systems Linux Red Hat Command for cumulative disk space
# 1  
Old 01-17-2013
Command for cumulative disk space

I wanted to know the Red Hat Linux command for cumulative disk space usage and the free space as df -h gives used and free space individually for the drives. Or, a command to check free space on the server would also be fine.

I hope, my question is clear.

Please revert with the reply to my query.

Regards
# 2  
Old 01-17-2013
There's got to be a neat way of summing a column which meets given criteria using awk only, which someone will no doubt enlighten me with.

In the interim, this works under bash and ensures that the tempfs isn't counted as real space
Code:
total_free=0;for i in $(df -k | egrep '^/dev'| awk '{print $4}' ) ; do total_free=$(($total_free + $i)); done ; echo Total free space on $(hostname) is ${total_free}K

# 3  
Old 01-18-2013
Thanks for your answer.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need Generic command for disk space usage

Given this directory /web I need to get the current usage (in %) on Linux and Unix both using the same command on bash shell ? The command i tried was working on Unix (solaris) but does not filter the desired same value when run of Linux. My command df -h /web | awk '{print $5}' | sed -n... (5 Replies)
Discussion started by: mohtashims
5 Replies

2. Solaris

Df -k command shows duplicate information in Solaris machine, How to get the exact disk space

While getting the total disk space in solaris machine using df -k command, i am getting the same disk info for every user available in that system. Is there any way to remove it. Filesystem 1024-blocks Used Available Capacity Mounted on rpool/ROOT/solaris 573898752... (3 Replies)
Discussion started by: prasankn
3 Replies

3. Solaris

Problem in getting total Disk space using iostat -En command

Hi Everyone, I try to calculate the total hard disk space of a solaris machine using iostat -En command. Iterating the output and summing up all the number present near the Size: will give the exact size of the harddisk. But it is not working for a machine. This command works in many flavors... (2 Replies)
Discussion started by: prasankn
2 Replies

4. Shell Programming and Scripting

Disk Space

Hi Guys i have a nice little piece of code then i need to modify so that is does not look at /Voulmes/* thanks sub disk_full { my $i = 0; open( DF, "df -l|" ); while (<DF>) { #chomp(); next if (/^\/proc\b/); $i++; next if ( $i == 1 ); ... (3 Replies)
Discussion started by: ab52
3 Replies

5. Solaris

command to get the total disk space (available + free)

is there a command to get the total disk space (available + free) on the solaris server ? thanks (3 Replies)
Discussion started by: sudhiroracle
3 Replies

6. Solaris

command to find free disk space on solaris

In linux df is the command to find free space what is the equivalent command in the Solaris (2 Replies)
Discussion started by: harishankar
2 Replies

7. Solaris

Disk space?

I'm a Unix newbie running Solaris 9. After installing a fresh copy on a 40GB drive I noticed the available disk space is 2% free or approximately 200MB available. Is that possible? Did I do something wrong? (4 Replies)
Discussion started by: jbarbuto
4 Replies

8. UNIX for Dummies Questions & Answers

available disk space on disk device???

Hello, Can someone please tell me which command to use to determine the available disk space on a given disk device? I have to write a shell script that compresses files and stores them in a specific location but I am not sure how "conservative" I should be? Thanks in advance! Al. (4 Replies)
Discussion started by: alan
4 Replies

9. Filesystems, Disks and Memory

Disk Space -

I know I have posted this question before, but I still just don't understand how to determine disk space. This server is an IBM RS6000 running on AIX version 4.2.1. I in essence need to know the following if anyone can assist me. 1) I need to know how many drives are configured in the... (2 Replies)
Discussion started by: Docboyeee
2 Replies

10. UNIX for Dummies Questions & Answers

Out of disk space?

Hi I'm trying to install gcc and the installation program tells me that I'm out of disk space! I have just installed the os (using the default settings for partitions and sizes) and have only installed apache on the machine. Can it really be out of disk space already? How do I check how much... (4 Replies)
Discussion started by: alfabetman
4 Replies
Login or Register to Ask a Question