Networking

Unix and Linux network configuration. Multiple network interfaces. Bridged NICs. High-availability network configurations.

Applications

Reviews of latest Unix and Linux software. Helpful tips for application support admins. Automating application support.

Data

Disk partitioning, filesystems, directories, and files. Volume management, logical volumes, HA filesystems. Backups and disaster recovery.

Monitoring

Distributed server monitoring. Server performance and capacity planning. Monitoring applications, network status and user activity.

Commands & Shells

Cool Unix shell commands and options. Command-line tools and application. Things every Unix sysadmin needs to know.

Home » Filesystems

Show Allocated / Used Filesystem Space Summary

Submitted by on April 17, 2012 – 9:31 pm 6 Comments

On servers with many filesystems calculating filesystem space utilization summary can get very tedious. Below is a simple script that will summarize all filesystems and provide you will the totals for allocated and used space in GB.

Allocated space:

i=0 ; df -kP | grep -v Filesystem | awk '{print $2}' |  while read line; do i=$(echo "${i} + ${line}" | bc -l); echo $i; done | tail -1 | while read line2 ; do echo "scale=2;${line2} / 1024 / 1024" | bc -l ; done

Used space:

i=0 ; df -kP | grep -v Filesystem | awk '{print $3}' |  while read line; do i=$(echo "${i} + ${line}" | bc -l); echo $i; done | tail -1 | while read line2 ; do echo "scale=2;${line2} / 1024 / 1024" | bc -l ; done
Print Friendly, PDF & Email

6 Comments »

  • stingerms says:

    Hi
    I am revising for an exam to do with Operating Systems and one of the past paper question asks ‘What issues would you expect to have to be addressed in adding compression to a traditional Unix filesystem’.

    I am nost sure where to start here. Can you help?
    Hi
    Sorry I mistyped the question. It is actually what issues would you expect to **have** to be addressed in adding compression to a traditional unix filesystem

  • Daniel says:

    hi all
    what is the fastest filesystem for linux ?

  • xLittle21Yaox says:

    I installed Jaunty Jackalope from a disc(using Wubi, I also use Windows Vista) and later upgraded to Karmic.
    I’m planning on clearing everything from my computer, but I don’t want to download the Karmic ISO all over again. Is it saved somewhere on my filesystem? If so, where?
    I tried the USB startup thingy… But it asks me for the ISO to use… Now what?

  • jag43216 says:

    My options are:
    Accounting 1
    Business Management
    International Business
    Principles of Marketing
    Business and Personal Law

    Here’s the link if you want to see a description of each of the classes. The business classes are on page 16:
    http://www.herricks.org/files/filesystem/HS%20Course%20Selection%20Guide1.pdf

  • Xavier Hawthorne says:

    Right now I’m using a flashdrive with Ubuntu on it and i erased and formatted my hardrive to nfts then fat 32 but both times when i try to boot the cd it says unsupported filesystem grub error

  • Anny says:

    How can I have the option to select which Operative System to run after the BIOS load.
    Details:
    Both OSs (x64) installed in separate partitions and with different filesystem.
    Partition where is installed Ubuntu, doesn’t appear on My PC.
    After the BIOS load, only Windows load up and there’s no clue about Ubuntu.

Leave a Reply

%d bloggers like this: