Linux Find Command

As name suggests find command finds file in a directory.

Basic syntax

find [PATH] [OPTIONS]

OPTIONS :
-name "pattern"
-type [f/d/l]
-mtime
-size
-exec

EXAMPLES:

# Finds all files in path and subdirectories
find . -name "regex"

# Excludes Subdirectories
find . -type f -name "regex"

# Find files, last modified n*24 hours ago
find . -mtime -n #Finds all File modified within last 1 Day

# Find file by size
find . -size +1024k

## Finds all files with with size greater than 1024 kB (Note : k - kB, M - MB, G - GB)*

Find and execute

find . -name "*.tmp" -exec ls -l {} \;
find . -name "*accelus" -exec scp {} username@hostname:/appserver/deployment/ \;