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
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!