Actions
Bug #2894
closedls(1) -1U can go much faster
Start date:
2012-06-18
Due date:
% Done:
100%
Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
External Bug:
Description
By default, ls(1) reads the entire contents of a directory into memory, sorts the entires, and calculates how to optimally show the output in columns. This is usually the right thing, but when a user wants only a simple unsorted list of files, saving them all in memory before printing a single one is counterproductive.
The -1 and -U options indicate that there should be one file printed per line and the output will be unsorted. When those are present, ls(1) shouldn't save each file in memory. Instead, it should print each entry as it reads them from readdir(3C).
If there are options present which require sorting (-S, -t) or additional output (-l, -i, -R, etc.), then ls(1) should work as usual.
Actions