Results 1 to 10 of 14
I use the following command to search for files that contain certain words
Code:
grep "Due Mtg" *.php
but, i cant seach the sub directory
I have to go into ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 12-13-2005 #1Linux Newbie
- Join Date
- Dec 2005
- Location
- Singapore
- Posts
- 234
Search command
I use the following command to search for files that contain certain words
but, i cant seach the sub directoryCode:grep "Due Mtg" *.php
I have to go into the directory and type the command again.
is that any shorter way to do it?Proper Planing is a way of success
- 12-13-2005 #2Banned
- Join Date
- Jul 2004
- Posts
- 947
as root
where / can be any dirCode:find / -iname foo
and foo is what you are searching for
- 12-14-2005 #3Linux Newbie
- Join Date
- Dec 2005
- Location
- Singapore
- Posts
- 234
I dont have the root permission
Originally Posted by the_guy_dressed_in_black Proper Planing is a way of success
- 12-14-2005 #4
well then only seach in directories you have permission
for example
find /home/jack/ -iname fooAll right, brain. You don't like me and I don't like you, but let's just do this and I can get back to killing you with beer. All New Users Read This!!! If you have a grub problem please look at GRUB MANUAL
- 12-14-2005 #5Linux Newbie
- Join Date
- Dec 2005
- Location
- Singapore
- Posts
- 234
but i dont know where the file is exist i cant get the expected result by typing the following command at the directory where i have permission
Originally Posted by spencerf
Code:find / -iname "TcpServer"
Proper Planing is a way of success
- 12-14-2005 #6
Let's say that your PHP files are all stored in /home/user/php/ . To find the line that you're looking for, you could do:
"What the hell is that?", you're asking.Code:find /home/user/php/ -iname '*.php' -exec grep -H 'TcpServer' '{}' \;
Well, it basically looks for every file in the directory you gave it AND ALL SUBDIRECTORIES THEREOF, and then executes "grep -H 'TcpServer' FILENAME" on each one. It will print out the name of each file that contains your string.
- 12-14-2005 #7Linux Newbie
- Join Date
- Dec 2005
- Location
- Singapore
- Posts
- 234
There are the command that i had type and the error that i get
Originally Posted by Cabhan
Code:msg@send-connect:~/apache/htdocs/exc$ find -iname '*.php' -exec grep -H 'TcpServer' '{}' find: missing argument to `-exec'
Proper Planing is a way of success
- 12-14-2005 #8Banned
- Join Date
- Jul 2004
- Posts
- 947
try it not being root, dont think it will returrn much
Code:find / -iname foo
- 12-14-2005 #9Linux Newbie
- Join Date
- Dec 2005
- Location
- Singapore
- Posts
- 234
Almost all the result that i get is "Permission denied"
Originally Posted by the_guy_dressed_in_black
Proper Planing is a way of success
- 12-14-2005 #10Banned
- Join Date
- Jul 2004
- Posts
- 947
thats what i thought would happen
Originally Posted by thcc2
could you not ask the admin to enter the root paaswd


Reply With Quote
