I have many files in a specific repository and i must find a file which has a specific string in its content (actually referencing the file Version.cc.in). What is the best solution to find it?
|
|
|
You could use grep:
For recusive search you could use
or
but, availability of |
|||||||||||
|
|
There is another tool similar to Ack, called The Silver Searcher. The developer claims that it "is like ack, but better. It’s fast. It’s damn fast. The only thing faster is stuff that builds indicies beforehand, like Exuberant Ctags." |
|||
|
|
|
If you just want to find and list the file, not the actual contents, then use the
Which will give you a list of all files and the absolute path to them (assuming the files are in directories/subdirectories of your current working directory). |
|||
|
|
|
You can use a tool called ack. It is descibed as:
Basically it is similar to grep in that it searches files for patterns, but with a few key differences. Namely, it searches recursively and ignores version control and backup files by default (e.g. CVS, .svn, foo~, #foo#). And since it is built with Perl it is cross-platform. It also allows you to specify particular file types within a directory to search, so if you only want to search Perl files you could type
If interested there is a list of the "top 10 reasons to use ack instead of grep" on the ack homepage. Plus, there is a Vim plugin. |
|||||||||
|