$ whatis find

find find (1) - search for files in a directory hierarchy

find find (1) - find files

Examples:


  1. find . -type f
  2. find . -type d
  3. find . -size 10k

    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 " man find " to see the Manual Page for this command.


Previous Home Page Next


Contact us      |      About us      |      Term of use      |       Copyright © 2000-2023 MyWebUniversity.com ™