Linux find file names with given string recursively

JJ Beck picture JJ Beck · Oct 30, 2012 · Viewed 124.9k times · Source

I'm on Ubuntu, and I'd like to find all files in the current directory and subdirectories whose name contains the string "John". I know that grep can match the content of the files, but I have no idea how to use it with file names.

Answer

Rich Adams picture Rich Adams · Oct 30, 2012

Use the find command,

find . -type f -name "*John*"