Skip to main content
The 2024 Developer Survey results are live! See the results

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

6
  • 13
    ...and for that matter you can leave out the '.'
    – Adam Mitz
    Commented Oct 29, 2008 at 6:01
  • 12
    For absolute paths, use find $(pwd) -name \*.txt
    – Zags
    Commented Sep 17, 2014 at 20:35
  • 3
    If pattern has part of the directory name should use -path "*docs/*.txt" instead of -name. -wholename is same as -path
    – dashesy
    Commented Feb 23, 2016 at 22:05
  • 9
    Use -type f to only return files and not directories, symbolic links, etc.
    – user
    Commented Nov 22, 2016 at 7:11
  • 3
    -name "*.txt" will NOT match file.TXT — always use -iname "*.txt" instead which is case-insensitive.
    – ccpizza
    Commented Jun 24, 2017 at 20:54