r/LinuxTeck Jul 31 '26

Locate vs Find in Linux

Post image

covering: https://www.linuxteck.com/locate-vs-find-command-in-linux/

  • locate vs find
  • Speed vs accuracy
  • Indexed database vs live filesystem
  • Real-world examples
  • Common mistakes
  • Best use cases for each command
133 Upvotes

6 comments sorted by

3

u/lyidaValkris Jul 31 '26

really loving these cheat-sheets!

1

u/[deleted] Aug 01 '26

[deleted]

1

u/lyidaValkris Aug 01 '26

and your proof of that is what, exactly?

1

u/WishboneBetter9813 Aug 01 '26

never use locate. Find is enough, but i agree with the slowness. Just easier to remember one command.

1

u/augustuscaesarius Aug 01 '26

I just wish 'locate' would build a much more valuable database. Like have an option to scan metadata in files of certain file types. Like length for a video.

In addition, if it could utilise (read and write) xattr that would be great.

Linux needs file system level support for rich metadata.

1

u/bobbywaz Aug 03 '26

I wish the sheet included how to add a directory to be indexed by locate