Tech Reflect

Tech Reflect

Share this post

Tech Reflect
Tech Reflect
Doing something with the “find” command

Doing something with the “find” command

Chris Hynes - cricket's avatar
Chris Hynes - cricket
Apr 04, 2017
∙ Paid

Share this post

Tech Reflect
Tech Reflect
Doing something with the “find” command
Share

The find command is one of those utilities that, if you know it well, is one of the most powerful tools in your toolchest. However, with a man page nearly 600 lines long and somewhat bewildering syntax, it’s very intimidating. Sometimes the simplest options you are looking for can be oddly named or unexpected.

I created a series of examples of how to do some very basic stuff with the find command, which is what most people really want to do. Each example builds on the previous one. Once you get comfortable, then you can look at the man page and add new options one at a time to get the hang of it.

# Find a file that contains the string "banana" in the current directory and all subdirectories
find . -name "*banana*"

# Search case insensitively
find . -iname "*banana*"

# Search only in the current directory
find . -maxdepth 1 -iname "*banana*"

# Search at a specific path rather than the current directory
find ~/Library/Logs -maxdepth 1 -iname "*banana*"

# Find files greater created mor…

Keep reading with a 7-day free trial

Subscribe to Tech Reflect to keep reading this post and get 7 days of free access to the full post archives.

Already a paid subscriber? Sign in
© 2025 Christopher Hynes
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture

Share