This article is in continuation of my earlier article Top 10 basic networking Commands in Unix and Top 10 most useful CVS command in Unix .
Here Iam listing down some of the way I use find command regularly, I hopethis would help some one who is new in UNIX and find command or anydeveloper who has started working on UNIX environment. this list is byno means complete and just some of my favorites , if you have somethingto share please share via commenting.
1) Running the last executed find command in Unix:
!find
Thiswill repeat the last find command executed. It saves lot of time if youre searching for something and you need to execute same command againand again. In fact "!" can be used with any command to invoke previous run of that command.
2) Finding files which has been modified less than one day in Unix:
find . -mtime -1
Thisis my favorite while looking out some issue just to check which fileshave been modified recently which could be likely cause of issue,believe me it helps a lot and many a times gives you enough hint of anyproblem due to intended or unintended file change.
3) List all the files and directories in the box which holds the 777 permission in Unix?
find . -perm 777 –print
I usethis command to find out all the executable files , you can also modifyit to find all the read only files or files having write permission etcby changing permissions e.g. to find all read only files in currentdirectory : find . –perm 555
Here "." or period denotes current directory. You can replace it with any directory you want.
4) How to do case insensitive search using find command in Unix? Use option “-i" with name, by default find searches are case sensitive.
find . –iname "error" –print
fore more tips plese see here Top 10 examples find command in Unix