Back to Blog

linux find

  • pathname: The directory path to search for files.
  • -options: Options to specify the search criteria.
  • -print: Print the matched files to the standard output.
  • -exec: Execute a shell command on the matched files.
  • -ok: Similar to -exec, but prompts the user for confirmation before executing the command.

Some common options used with find include:

  • -name: Search for files by name.
  • -perm: Search for files by permissions.
  • -user: Search for files owned by a specific user.
  • -group: Search for files owned by a specific group.
  • -mtime: Search for files modified within a specified time range.
  • -size: Search for files of a specified size.
  • -nogroup: Search for files without a valid group.
  • -newer: Search for files modified after a specified file.
  • -depth: Search for files in the specified directory and its subdirectories.

Here are some examples of using find: