How to inspect really large directories

Posted . Visible to the public.

When a directory has more than a few thousand entries, ls will start taking really long to list its content. Reason for this is that ls by default a) sorts the file names and b) prints them in columns. For both, it needs to know (thus load into memory) the whole list of files before it can start printing anything.

By disabling sorting and columns, you get a lean, superfast ls that prints "live" as it reads:

$> ls -f -1
file1
file2
...
file9999
file10000
file10001
...
Dominik Schöler
Last edit
Dominik Schöler
License
Source code in this card is licensed under the MIT License.
Posted by Dominik Schöler to makandra dev (2016-10-28 08:08)