how to search file's content with shell?
in the directory : /home/files/
has many files ,such as
1.php 2.php 3.php 4.php
5.php 6.txt 7.c
and i want to search the content of these files，such as 1.php's content is
how can i through a keyword "function" to find the file 1.php or more with shell?
grep -R "search keyword" /home/files
or if your grep isn't recursive enabled,
find . -type f -name "*.php" -print | xargs grep -i "keyword"
file all files in any subdirectory,
starting from this directory,
that are named *.php
inside of which there is a match for keyword, case insensitive.
|All times are GMT -5. The time now is 08:20 AM.|