find find (1) - search for files in a directory hierarchy
find find (1) - find files
Here are some more examples with using find command.
To remove all the core files found under the directory /opt/Application1 and it's subdirectories:
$ find /opt/Application1/. -name "core" -exec rm {} \;
To find and list all files in the /opt/apache2 that has the string "DocumentRoot" in it's contents, and ignoring the case for string matching.
$ find /opt/apache2/. -name "*" -exec grep -il "DocumentRoot" {} \;
To find the file httpd.conf file in the /opt/apache2 directory and display it's contents.
$ find /opt/apache2/. -name "httpd.conf" -exec cat {} \;
To find files in the current diretory that has the permission 755.
$ find . -perm 755
To find files that are equal or greater than 100k.
$ find . -size 100k
Please click on " find in PDF " format.
Please click on " find in HTML " format.