Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Summary: Sorting files
- X-seq: zsh-users 9257
- From: Christian Taylor <cht@xxxxxxxxx>
- To: "zsh-users" <zsh-users@xxxxxxxxxx>
- Subject: Re: Summary: Sorting files
- Date: Sat, 6 Aug 2005 11:22:16 +0200
- In-reply-to: <20050806.073835.71083870.Meino.Cramer@xxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20050806.073835.71083870.Meino.Cramer@xxxxxx>
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author