zsh-users
 help / color / mirror / code / Atom feed
From: Christian Taylor <cht@chello.at>
To: "zsh-users" <zsh-users@sunsite.dk>
Subject: Re: Summary: Sorting files
Date: Sat, 6 Aug 2005 11:22:16 +0200	[thread overview]
Message-ID: <200508061122.16844.cht@chello.at> (raw)
In-Reply-To: <20050806.073835.71083870.Meino.Cramer@gmx.de>

Meino Christian Cramer wrote:
> One way around this trap is a "longer" script:
>
>     for i in **/*bz2(.ol)
>     do
>       ls -l ${i}
>     done
>
> which won't give ls the chance of sorting anything, cause it only sees
> one file at a time. The drawback is a call to ls on *every* file and a
> somehow bulky command.
>
> If you get an "arg list to long"-error after submitting
>
>    ls -l **/*bz2(.oL)
>
> then the above script is a solution for that. But if not the following
> does, what you want:
>
>    ls -sS -- **/*.bz2(.)

As a compromise, I would suggest using the following:
(you need to autoload zargs first, either manually or in your .zshrc)

zargs -- **/*.bz2(.oL) -- ls -lU

This should work better than the for-loop because zargs calls ls with a few 
thousand arguments at a time, resulting in much fewer calls.
Although the manpage for ls claims that -U displays files without sorting, "in 
whatever order they are stored on the disk", on my system it displays them in 
the order of the arguments it is called with. Therefore, you can use any 
combination of sorting that zsh provides.

Christian


  reply	other threads:[~2005-08-06  9:23 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-04 18:38 Meino Christian Cramer
2005-08-04 18:48 ` Mikael Magnusson
2005-08-04 19:10   ` Meino Christian Cramer
2005-08-04 19:18     ` Danek Duvall
2005-08-04 20:41       ` Stephane Chazelas
2005-08-05  3:01         ` Meino Christian Cramer
2005-08-05 10:47           ` Stephane CHAZELAS
2005-08-04 19:14 ` Christian Schneider
2005-08-04 21:19   ` Jens Kubieziel
2005-08-05  3:06   ` Meino Christian Cramer
2005-08-04 19:51 ` Christian Taylor
2005-08-05 10:51   ` zzapper
2005-08-05 12:57     ` Christian Taylor
2005-08-05 14:41     ` Meino Christian Cramer
2005-08-06  5:38     ` Summary: " Meino Christian Cramer
2005-08-06  9:22       ` Christian Taylor [this message]
2005-08-05 12:52 ` DervishD
2005-08-05 14:01   ` Meino Christian Cramer
2005-08-05 14:29     ` Mikael Magnusson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200508061122.16844.cht@chello.at \
    --to=cht@chello.at \
    --cc=zsh-users@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).