Read more

How to inspect really large directories

Dominik Schöler
October 28, 2016Software engineer at makandra GmbH

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.

Illustration UI/UX Design

UI/UX Design by makandra brand

We make sure that your target audience has the best possible experience with your digital product. You get:

  • Design tailored to your audience
  • Proven processes customized to your needs
  • An expert team of experienced designers
Read more Show archive.org snapshot

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
...
Posted by Dominik Schöler to makandra dev (2016-10-28 10:08)