find Linux Command Cheatsheet

3864




find Linux Command is used to locate files in directories. By default find looks for files in current directory.

Syntax

find [option(s)] [Path] [expression]
OptionDescription
-PNot follow symbolic links (default behaviour)
-LFollow symbolic links
-HFollow symbolic links only while processing command line arguments

Examples

Consider the following directory structure

$ tree
.
├── images
│   ├── cat.png
│   ├── dog.png
│   ├── moon.png
│   └── sun.png
├── movies
│   ├── action
│   │   ├── bar.mp4
│   │   └── foo.mp4
│   └── comedy
├── music
│   ├── song1.mp3
│   └── song2.mp3
└── readme.txt

5 directories, 9 files
find . -name cat.png
./images/cat.png
find . -name cat*
./images/cat.png
find . -name *.png
./images/dog.png
./images/moon.png
./images/cat.png
./images/sun.png