#2 FIND utility
Here I am giving the “find” command utility’s purpose which will be very useful for quite to be familiar with your linux box
I am following from this day itself.Hope will be useful for you.
Very simple to learn.
Description:
basically find command used to find a file/directory in particular location.It will be used to find based on size,type,name,mtime..etc.
Examples:
Find a file using it’s name
find . -name “nava.txt”
find . -iname “navA.txt”
Here .(current directory,-name(case sensitive name of the file))
Find Empty file in / directory
find / -empty
Find Non-Hidden empty files
find / -maxdepth -1 -empty -not -name “.*”
Find TOP 5 big files in Current directory
find / -type f -exec ls -s {} \; | sort -n -r | head -5
Find TOP 5 small files in Current Directory
find / -type f -exec ls -s {} \; | sort -n | head -5
Find TOP 5 small files except empty files
find / -not -empty -type f -exec ls -s {} \; | sort -n | head -5
Find all Directories
find / -type d
Find all files
find / -type f
Find Hidden Files
find / -type f -name “.*”
Find files by size
find / -size +100M
Note:{ +100M ( > 100MB) , -100M( < 100MB), 100M (== 100MB) }
Finally:
Thanks for your time

