page

Apr 13, 2017

Linux find command

for more information, visit
http://www.binarytides.com/linux-find-command-examples/


basic syntax
$ find location comparison-criteria search-term


searches for files by their name
$ find ./test -name "abc.txt"
./test/abc.txt
wildcards
$ find ./test -name "*.php"
./test/subdir/how.php
./test/cool.php
all sub directories are searched recursively. So this is a very powerful way to find all files of a given extension.
Trying to search the "/" directory which is the root, would search the entire file system including mounted devices and network storage devices. So be careful. Of course you can press Ctrl + c anytime to stop the command.

No comments:

Post a Comment