Bref

In general, Finding the file what you want to use is find. but there’re more.

Let’s rolling

  1. locate

    this command, it will search its own db in sys where in /var/lib/mlocate/mlocate.db and it will update once aday in the morning automatically.

    1
    locate locate

    And more. To update the db file immediately use updatedb when you want to update the mlocate.db

  2. which

    To find the executable file in “${PATH,MANPATH}”

    1
    2
    3
    which cd ls
    #cd: shell built-in command
    #ls: aliased to ls -G
  3. whereis
    To check the standard binary directories for the specified programs, printing out the paths of any it finds

    1
    2
    whereis ls
    #/bin/ls