Or install (locally) the superior tool di, which supports CSV output

$ df Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda1 1918133328 118161992 1798006108 7% / devtmpfs 8208688 40 8208648 1% /dev tmpfs 8222552 972 8221580 1% /dev/shm tmpfs 8222552 830192 7392360 11% /run tmpfs 8222552 0 8222552 0% /sys/fs/cgroup tmpfs 8222552 830192 7392360 11% /var/run tmpfs 8222552 830192 7392360 11% /var/lock /dev/sdb1 1952559608 52871420 1899688188 3% /pro $ di Filesystem Mount Size Used Avail %Used f +s Type /dev/sda1 / 1.8T 0.1T 1.7T 6% e +xt4 tmpfs /dev/shm 7.8G 0.0G 7.8G 0% t +mpfs /dev/sdb1 /pro 1.8T 0.0T 1.8T 3% x +fs tmpfs /run 7.8G 0.8G 7.0G 10% t +mpfs tmpfs /sys/fs/cgroup 7.8G 0.0G 7.8G 0% t +mpfs tmpfs /var/lock 7.8G 0.8G 7.0G 10% t +mpfs tmpfs /var/run 7.8G 0.8G 7.0G 10% t +mpfs $ di -c s,m,b,u,v,p,T "/dev/sda1","/","1.8T","0.1T","1.7T",6%,"ext4" "tmpfs","/dev/shm","7.8G","0.0G","7.8G",0%,"tmpfs" "/dev/sdb1","/pro","1.8T","0.0T","1.8T",3%,"xfs" "tmpfs","/run","7.8G","0.8G","7.0G",10%,"tmpfs" "tmpfs","/sys/fs/cgroup","7.8G","0.0G","7.8G",0%,"tmpfs" "tmpfs","/var/lock","7.8G","0.8G","7.0G",10%,"tmpfs" "tmpfs","/var/run","7.8G","0.8G","7.0G",10%,"tmpfs" $ di -c | perl -MDP -MText::CSV_XS=csv -wE'DDumper(csv(in=>*STDIN,key= +>"m")->{"/"})' { T => 'ext4', b => '1.8T', m => '/', p => '6%', s => '/dev/sda1', u => '0.1T', v => '1.7T' }

Alternatively, you could use a CPAN module like Filesys::DiskSpace (no updates since 1999) or Filesys::DfPortable (no updates since 2006).


Enjoy, Have FUN! H.Merijn

In reply to Re^4: doughnut charts with gd:graph by Tux
in thread doughnut charts with gd:graph by theravadamonk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.