# by case-insensitive extension (.jpg, .JPG, .Jpg)
find . -iname "*.jpg"
# directories
find . -type d
# files
find . -type f
# symlinks
find . -type l
# hardlinks, files that are hardlinks to <myfile>
find . -type f -samefile '<myfile>'
# find files by octal permission
find . -type f -perm 777
# To find files with setuid bit set:
find . -type f -xdev \( -perm -4000 \) -print0 | xargs -0 ls -l
# find files owned by 'username' and list file information
find . -type f --user=username -ls
find . -mindepth 1 -maxdepth 3
# find files modified more than 7 days ago and list file information
find . -type f -mtime +7d -ls
# find files with extension '.txt' and remove them
find ./path/ -name '*.txt' -exec rm '{}' ';'
# find and delete empty directories
find . -type d -empty -exec rmdir '{}' ';'
# find files with extension '.txt' and look for a string into them
find ./path/ -name '*.txt' | xargs grep 'string'
# find files with size bigger than 5 Mb and sort them by size
find . -size +5M -type f -print0 | xargs -0 ls -Ssh | sort -z
# find files bigger than 2 MB and list them
find . -type f -size +20000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'
find . -type f -name 'foo*' -delete -print
find . '!' -iwholename '*.git*' -type f
Find all python sub-packages without an __init__.py
find . -type d '!' -exec test -e "{}/__init__.py" ';' -print
# find files with size bigger than 5 Mb and sort them by size
find . -size +5M -type f -print0 | xargs -0 ls -Ssh | sort -z
# find files and sort by size
find . -type f -exec du -h {} + | sort -r -h | head
inode=$(ls -i /path/to/file | cut -d ' ' -f 1)
find . -inum "$inode" -exec rm -i '{}' ';'