Linux disk space

Posted by Eric Stein - March 2, 2007 CE @ 07:04:06 UTC
On my *nix boxes, I often find myself using df to check my free space. Unfortunately the Linux pseudo-filesystems such as /dev and /dev/shm clutter up the space with useless info. As usual, it took me a year to realize I could do something about it, so it wasn't until now that I wrote this shell script:
#!/bin/sh
mount|egrep "^/"|cut -f3 -d' '|xargs df -h

Using this script, you will see the same thing as the output of df -h, but showing only the filesystems that are 'real' (a device or file is mounted, not a kernel structure or network filesystems.
eastein@glamdring:/home/eastein$ ds
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda4              63G   29G   35G  46% /
/dev/sda3             7.7G  139M  7.6G   2% /tmp
/dev/hdc              150G  138G   12G  93% /home

Much prettier, no?
Last Edited February 7, 2011 CE @ 06:51:32 UTC

Comments

There are no comments yet.

Post a Comment

Name
Email (not published, I won't spam you)
URL (optional)
Title
Comment
opposite of good?
Worth Saying
Valid XHTML, CSS, RSS | 2ms | Copyright 2004-2024 Eric Stein