Contents / Previous / Next


Search for Files: find and locate


find: Search for files in a directory hierarchy.

      find [path...] [expression]

Search criteria:

   -name pattern : Base of file name

   -iname pattern : Base of file name but ignore case.

   -atime n : File was last accessed n*24 hours ago

   -type c : File is of type c: 
             d=directory, f=regular file, l=symbolic link, ...

Examples:

    find . -iname  "*.gif"


locate: List files in databases that match a pattern.


Options:

-i, --ignore-case : Ignore case in both the pattern and the file names

Examples:

    locate .emacs