Could also try /usr/gnu/bin/ls -U.

I'm working on improving the memory profile of /bin/ls (as it gets
somewhat excessive when dealing with large directories), which as a
side effect should also help with this.

Currently /bin/ls allocates a structure for every file, and doesn't
output anything until it's finished reading the entire directory, so
even if it skips the sort, that's generally a fraction of the total
time spent, and doesn't save you much.

The structure also contains some duplicative data (I'm guessing that
at the time -- a _long_ time ago, the decision was made to precompute
some stuff versus testing the mode bits -- probably premature
optimization, even then).

I'm trying to make it so that it does what's necessary and avoid
duplicate work (so for example, if the output doesn't need to be
sorted it can display the entries as they are read -- though the
situations where this can be done are not as often as you think).
Hopefully once I'm done (I've been tied down with some other stuff),
I'll be able to post some results.

On Wed, Feb 24, 2010 at 7:29 PM, Kjetil Torgrim Homme
<kjeti...@linpro.no> wrote:
> "David Dyer-Bennet" <d...@dd-b.net> writes:
>
>> Which is bad enough if you say "ls".  And there's no option to say
>> "don't sort" that I know of, either.
>
> /bin/ls -f
>
> "/bin/ls" makes sure an alias for "ls" to "ls -F" or similar doesn't
> cause extra work.  you can also write "\ls -f" to ignore a potential
> alias.
>
> without an argument, GNU ls and SunOS ls behave the same.  if you write
> "ls -f *" you'll only get output for directories in SunOS, while GNU ls
> will list all files.
>
> (ls -f has been there since SunOS 4.0 at least)
> --
> Kjetil T. Homme
> Redpill Linpro AS - Changing the game
>
> _______________________________________________
> zfs-discuss mailing list
> zfs-discuss@opensolaris.org
> http://mail.opensolaris.org/mailman/listinfo/zfs-discuss
>
_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to