HOWTO: The power of FIND

Another way of searching for files is using the command “find”. In this howto you’ll see different ways of using find. I will point out the most typical situations. Looking for:

The biggest files modified the last 24h. Typical when a partition is growing significantly and you want to know who is to blame

find ./ -mtime -1 -ls | sort -k7rn | more

Files ended with an special extension. For instance log files ending with .log

find ./ -name “*.log” -ls | more

or mp3 files

find ./ -name “*.mp3” -ls | more

Files by name

find ./ -iname nameofthefile | more (with iname we are searching case insensitive)

With the use of pipes you can do a lot more. Imagination is welcome!!

Advertisements

About jordilin

I'm a Senior Software Engineer with an MSc in Telecommunications Engineering. I've got a range of interests including Linux, a very powerful and limitless operating system, travelling, gastronomy and technology.
This entry was posted in HOWTOs. 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