Locating files

  • Various methods can be used to locate files in the filesystem:

    which command

    Determine the location of command and display the full pathname of the executable program that the shell would launch to execute it.

    find paths expression

    Search for files that match expression, starting at paths and continuing recursively.

    locate patterns

    Locate files whose names match one or more patterns by searching an index of files previously created.


    Refresh (or create) the slocate database, usually via cron.

    whatis keywords
    apropos keywords

    Search the whatis database for keywords. whatis finds only exact matches, whereas apropos finds partial word matches.

Get LPI Linux Certification in a Nutshell, 3rd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.