find-command


find

search for files in a directory hierarchy

Basic syntax

$ find [OPTIONS..] [path...] [expression]
Basic Examples
$ find -name "query" # case sensitive $ find -iname "query" # ignore the case of the query $ find -not -name "not_query" # avoid a query
Finding By File types
$ find -type [descriptor] [query]

Basic descriptors:

  • f: regular file
  • d: directory
  • l: symbolic link
  • c: character devices
  • b: block devices

Options

OptionsUse
-name [pattern]Base of file name matches shell pattern. The metacharacters (*, ?, and []) match a . at the start of the base name.
-iignore case
-typetype of file (f|d|l|c|b)
-sizefilter by size (c|k|M|G|b)
-permfilter by permissions
-LFollow symbolic links

Follow me on : Medium Linkedin Researchgate

© Krishna Neupane Since @ 1995. All rights reserved.