find

Find is a very powerful, but complicated command. You can do any of the following things with find:

  • Search on a filename
  • Search on permissions (both user and group)
  • Search on ownership
  • Search on file type
  • Search on file size
  • Search on timestamps (created, last-modified, last-accessed)
  • Search only in certain directories

It would take a full chapter to explain all of the functionality in the find command. We will only be describing the most common use cases. The real lesson here is being aware of the advanced functionalities of find; if you ever need to look for files with a specific set of attributes, always think of the find command first and check out the man file page to see if you can utilize find for your search (spoiler alert: ...

Get Learn Linux Shell Scripting - Fundamentals of Bash 4.4 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.