how can I find all the files in different folds which contains a word?
what can I do?
|
|
midnight commander AKA "mc" will also do it for you
command > find file mc is a CLI program so you have to run it from a some kind of terminal |
I am just using PERL File::Util to get out all files and directories .
|
grep -R
|
grep -rl "text-to-search-for" /path/to/files
|
#!/usr/bin/perl
use feature ':5.10'; use warnings; use strict; use File::Util; my($f) = File::Util->new(); my(@dirs_and_files) = $f->list_dir('/home/mei/Downloads/core.samples.v0.1b6/effo','--recurse'); foreach(@dirs_and_files) { my($myfile) = $_; open(my $fh, '<', $myfile) or continue; while(<$fh>){ chomp; if($_ =~ m/__GNUC__/){ say $myfile; last; } } } a simple solution. |
All times are GMT -5. The time now is 10:50 PM. |