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 online protection

Rails Long Term Support

Rails LTS provides security patches for old versions of Ruby on Rails (2.3, 3.2, 4.2 and 5.2)

  • Prevents you from data breaches and liability risks
  • Upgrade at your own pace
  • Works with modern Rubies
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)