Project

General

Profile

Actions

Bug #2894

closed

ls(1) -1U can go much faster

Added by Bill Pijewski about 9 years ago. Updated about 9 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
cmd - userland programs
Start date:
2012-06-18
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

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 #1

Updated by Rich Lowe about 9 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

Resolved in r13734 commit:41fe4dd8e23d

Actions

Also available in: Atom PDF