LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] ugly df

[ILUG] ugly df

Badger badger at scattermail.com
Sat Nov 11 12:57:49 GMT 2006


On Sat, Nov 11, 2006 at 07:51:20AM +0900, Josh Glover wrote:
> On 11/11/06, Paul Reilly <paulr at maths.tcd.ie> wrote:
> 
> >Anyone know a simple way to make df display it's output nicely?
> 
> <snip/>
> 
> >I suppose you could do this by recompiling, or wrapping 'df' in some
> >script to format it nicely. But there must be a better way.
> 
> Wrapping df in a script, or better yet piping its output to another
> program or programs is The Unix Way. Kitchen-sink options-having
> programs like GNU ls(1) are not The Unix Way. :)
> 

Yeah, a script is the way to go here. You can do the sorting part on the
command line quite cleanly with the following perl:

    df -h | perl -e "@t = <>; print shift @t; print sort @t;"

But to join up broken lines and get the whole output to look pretty
is a bit too nasty for any one-liners that I know.

- badge




More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell