grep

Finding files with find

Finding files with the find command is actually more difficult than it should be.
This finds and lists the largest files (more than 200 MB) on the whole file system:
find / -type f -size +200000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'
The same, but simpler syntax:
find / -size +200M -ls
This finds the most recently changed files under the current directory:
find . -type f -printf '%TY-%Tm-%Td %TT %p\n' | sort

Recursive grep

grep (case-insensitive, recursive) grep doesn't offer any possibility to recursively descent down the directory tree. The following command searches e.g. just thru all the files in the current directory:

grep bacteria *

To make the search case-insensitive, one can use the i flag:

grep -i bacteria *

But if you want to do a recursive search you have to use a quite complicated construction of UNIX commands to achieve this goal:

find ~/Mail -type f -exec grep 'bacteria' {} \; -print