find – explained through a screencast

September 1, 2013
linux command-line

I usually enjoy my Sunday doing something new, creative … like a few months back I started drawing. Then I paused but I think I’ll get back to drawing soon.

Anyway, drawing will be for another Sunday. Since I re-installed openSUSE 12.3 with MATE on my laptop I haven’t installed all other applications that I usually use. So, I went on an apps-installation spree. While installing Audacity & Avidemux I said why not making a short screencast to make the Sunday afternoon a wonderful one. Then I thought I could not complete the technical discussion regarding find command during the Linux mini-meetup. I sat down and prepared a script for the screencast. Everything set, I recorded a screencast of approx 8 mins and edited the same with Avidemux. I’m not pro in the editing things but I find my way to get things done. The output wasn’t a great video but I was happy with it.

See the final product on Youtube (for best visual experience watch in 480p).

####Update 02.09.13

Like Selven highlighted on facebook, xargs does make life on Earth sweeter.

Instead of using the -exec option we can pass the find output to xargs and achieve a myriad of things we wish.

find . -type f -iname “*error” -print | xargs rm -f

To search for files using file size:

find . -type f -size +1000c -print

1000c = 1K, therefore when searching for files in megabytes, make sure you add 6 zeroes, e.g 1M = 1000000c.

One last thing if you have another mounted device under your current directory and you don’t want find to look into that use -xdev to skip it.

find . -xdev -type f -size +10000000c -size -50000000c -print

In the above example find will search only within the current device files that are between 10M and 50M.

City Council of Barcelona switches from Microsoft Windows to Linux

February 11, 2018
linux ubuntu microsoft open source data protection website compromised?

December 7, 2017
linux wordpress security

Linux Magazine's special edition on openSUSE

November 20, 2017
opensuse linux university-of-mauritius education