Results 1 to 2 of 2
I want to search multiple files in multiple directories for the content "language" within the file.
For example, find all files on the server named "index.php" which have the content ...
- 02-15-2008 #1Just Joined!
- Join Date
- Feb 2008
- Posts
- 1
Searching File Contents
I want to search multiple files in multiple directories for the content "language" within the file.
For example, find all files on the server named "index.php" which have the content "language" within the php file. Thanks.
I found the following command: 'grep -r "language" *' However, this only searches the directory you are in, and no subdirectories.
It will also need to show the (absolute) path of the files which contain 'language'
- 02-15-2008 #2
The "-R" option means recursively, so it will search all other subdirectories:
"-l" just means "don't print the line that matched, just tell me the name of the file."Code:alex@danu ~/test/bash $ grep -lR foo * test_dir/file test_dir/subdir/file
Hope that helps!DISTRO=Arch
Registered Linux User #388732


Reply With Quote