Re: [SLUG] quoting

From: Kwan Lowe (kwan@digitalhermit.com)
Date: Fri Dec 16 2005 - 18:56:13 EST


> OK, I'l having a quoting problem. Not people taking things out of context,
> or using quotes without attribution, shell quoting. What I want is the "du
> -sh"-style output, only sorted by size. The only way I can see to do that
> is to get the "du -s"-style output, sort it, trim off the size, and call "du
> -sh' on each one. Rather inefficient, but I don't see a better way.
> (Sorting "du -sh"'s output will put "100M" before "200K".)

Try this:

 ls |xargs du -sk|sort -n|cut -f2|xargs du -sh

It does a two-pass display. First, grab the output in kilobytes, then sort by size.
Pass this output to 'du -sh' but this time show the human-readable format.

-- 
* The Digital Hermit   http://www.digitalhermit.com
* Unix and Linux Solutions   kwan@digitalhermit.com
-----------------------------------------------------------------------
This list is provided as an unmoderated internet service by Networked
Knowledge Systems (NKS).  Views and opinions expressed in messages
posted are those of the author and do not necessarily reflect the
official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 19:56:37 EDT