Useful linux find command that developer should know

Working with Linux is fun when we can make the best use of linux commands. Linux find command is very useful in case of finding things in real quick. But if we can provide the proper parameter to the find command then it becomes tedious to find things on Linux OS. Following are some really useful find command:

Find a html file that has a keyword

$ find . -type f -name "index.html" -exec grep -il "portfolio" {} \;

Find files that has a size of 100M

$ find / -size 100M

Find files those are greater than 1 GB and older than 6 months

$ find /path -mtime +180 -size +1G

Find directory using directory name

$ find / -type d -name "*name-of-the-direcotry*"

In Mac, the following command also works along with the above command
$ mdfind kind:folder "*name-of-the-direcotry*"

Find files using file name

$ find / -type f -name "*name-of-the-file*"

In Mac, the following command also works along with the above command
$ mmdfind -name file-name
Share