tip: how to find the file you need to edit using GREP

I’m sure this is an obvious technique to most of you, but I see enough “which file do I need to edit?” posts that its probably worth mentioning.



If you have shell access to your server, GREP can be a very quick way for you to find the file you need to edit. GREP searches the contents of the file, so you can search for a particular language variable, for instance.



The syntax is pretty simple:

# grep -R some_variable_you_want_to_find some_cart_directory/



The “-R” tells grep to descend into all subfolders recursively. The command returns a list of files that match along with a snippet of surrounding code.



This is basic knowledge for the Linux geeks here, but I wish I had been shown this years ago.



cheers,

Glen

For windows you can use:



[url]harddisksearch.com is for sale | HugeDomains free app



I have a demo setup on my windows machine and I can quickly customize infile search.

Nice one Texas,

I have been using notepad plus but have many problems.



John

I’ll try that one TexasGuy. Thanks for the link.



Edit: Doesn’t want to run on Windows 7 32bit