Re: [SLUG] quoting

From: Eben King (eben1@tampabay.rr.com)
Date: Fri Dec 16 2005 - 19:22:21 EST


On Fri, 16 Dec 2005, Kwan Lowe wrote:

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

Works on $PWD. What if I want to look at dirs elsewhere, or if they're not
all in the same place? I don't know a satisfactory method of passing info
into xargs. There's "--replace", but apparently I don't know how to use it.

-- 
-eben    ebQenW1@EtaRmpTabYayU.rIr.OcoPm    home.tampabay.rr.com/hactar

"You're one of those condescending Unix computer users!" "Here's a nickel, kid. Get yourself a better computer" - Dilbert.

----------------------------------------------------------------------- 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:47 EDT