Find filename recursively on terminal

Find by filename

find . -name xxx.txt
find /directory -name "xxx.txt"
find . -print | grep -i "xxx.txt"

 Find by size

find . -type f -size +50K
find . -type f -size +50M
find . -type f -size +50M -exec ls -lh {} \; | awk '{print $9 ": " $5}'

Find by size using disk usage

du -xakh . | sort -n
du -xakh . | sort -n | tail -50

Find directory recursively

sudo find /look/dir -type d -name "myFlaskApp"

Find filenames ending with “*.java”

find . -type f -name *.java

Find not ending with *.java

find . -type f ! -name *.java

Find not *.java not *.html

find . -type f ! -name *.java ! -name *.html

Find any file without extension

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

Leave a Comment

Your email address will not be published. Required fields are marked *