In directory with many files but only a few directories autocomplete is very slow for directories. If I type cd something tab it will take ages to autocomplete. Presumably this is because it is searching through all the files. However, it is already set up (by default) to only autocomplete to directories (as explained in Can the command completion for `cd` be modified to only show directories and ignore files?) so it should have no business searching the files. Is there anything I can do about this?

(On: Ubuntu 18.04.1 LTS)

  • 3
    The filesystem does not store directory and file entries separately. It still has to list everything to figure out what is a directory and what isn't.
    – jordanm
    Apr 18 '19 at 9:05
  • @jordanm, thanks, yet ls -d */ works instantaneously in the same directory. Somehow it knows how to look just for the directories.
    – Kvothe
    Apr 18 '19 at 10:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.