Re: df -h listing
On Mon, Oct 08, 2007 at 08:12:33AM -0400, Kevin Mark wrote:
> On Mon, Oct 08, 2007 at 01:46:10PM +0200, Wolodja Wentland wrote:
> > On Mon, 2007-10-08 at 13:24 +0200, roberto wrote:
> > > hello
> > > i use the "df -h" or "du -h"command to check how much disk space is
> > > occupied by files and directories
> > >
> > > but is it possible to sort the output list in an order such that the
> > > first (or conversely the last) item is the largest in size ?
> >
> > You can achieve this by sorting the output produced by df/du like this:
> >
> > "df -h|sort -k2"
> >
> > The "-k2" tells sort to sort by the second column. If you want it sorted
> > in reverse order add the "-r" option.
> >
> > Hope that answers your question
> I think you missed someting? like the -n flag? If you do a normal sort,
> its alphabetic. With -n, it is done numeric.
That's true but it doesn't help anyway. 57K will sort larger than 2M.
--
"Most people are other people. Their thoughts are someone else's opinions,
their lives a mimicry, their passions a quotation." -- Oscar Wilde
Rick Pasotto rick@niof.net http://www.niof.net
Reply to: