Command of the day

#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 😉

Advertisements

About Navaneethan

mixed feelings...
This entry was posted in Free Software, General_Tech, Ubuntu and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s