I have folder that apparently has millions of files inside it.
As result, dir
command is running for minutes already without displaying anything.
I checked dir --help
and tried to search for solution.
How can I list files in category - with streaming, so command starts showing something quickly also if folder has millions of files?
I have no idea what is in the affected folder.
ls
will sort its output alphabetically by default, so it needs to read the content of the whole directory, before it is shown.You can avoid sorting by running
ls
with-U
.But,
ls
will also read the type of each file/directory to be able to color it. This has also an impact on the performance. Avoid this with-f
flag.I usually use
See also