Find files recursively in linux shell

The basic syntax

Find a file with exact name in a directory:

find {directory} -name {filename}

Find a file matching a pattern in a directory:

find {directory} -name '{pattern}'

Examples of common use

Find a file recursively named “foo.bar” in current directory:

find . -name foo.bar

Find a file recursively named “foo.bar” on the system:

find / -name foo.bar

Find a file recursively which name contains foo:

find . -name '*foo*'
Linux Shell / Bash Scripting, Tutorials | Posted on June 29, 2013 by .

About Kristijan Burnik

Kristijan Burnik is a Programmer and Web Developer specializing in Server-side and Client-side Technologies and Application Development on Linux Servers and Windows Desktop . Also has experience in Networking, Desktop application development as well as Android mobile application development . Experienced in Programming Languages like Java, C, C++, C#, PHP, Javascript, MySQL and somewhat in other languages like Bash, Perl & Python. Sometimes he works as a Graphical Designer for digital production as well as for printing and advertising. He dedicates his spare time writing Tech Articles on his blog in order to share his work with others, as well as to document his projects for his own use. He's also an Educator & Mentor in field of Algorithms and Programming to young programmers in Zagreb, Croatia.

Leave a Reply