07-28-2008
grep -iR <phrase>
<phrase> -> word you want to search if you want to search a sentence enclose within '' (single quotes)
To make your search more faster if you know what type of files to be searche use the following
find -iname "*.xml" | xargs grep -iR <phrase>
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hello,
i want to make a script to search the file contents in my home directory by a given date and output me the line that has the date... (10 Replies)
Discussion started by: psychobeauty
10 Replies
2. UNIX for Advanced & Expert Users
Hi,
I would appriciate if somebody can help me figure out how to search for all the *.xml file under a specific directory and subdirectroies (/home/username) and later search of content "<start>" inside the xml file returned by search.
-Lovin.V (2 Replies)
Discussion started by: lovi_v
2 Replies
3. UNIX for Dummies Questions & Answers
Hi,
I have a problem when searching a file, the file containt with the following:
95671660:Jones:Sarah:45:sales manager
93272658:Smith:John:43:technical manager
98781987:Williams:Nick:35:computer officer
99893878:Brown:Sarah:12:electrician
95673456:Couch:David:26:chef... (3 Replies)
Discussion started by: elenatec
3 Replies
4. Shell Programming and Scripting
I am not sure if this is doable. I am trying to open and print the content of the file by replacing all instances fo perl to PERL . This is my code but it is
giving me the number count instead of the actual lines with changes.
open (PERLHISTORY, 'sample.txt') or die "The file sample.txt could... (3 Replies)
Discussion started by: jxh461
3 Replies
5. Shell Programming and Scripting
How can I search for a string in a filename? For example, I want to know if a filename (not the file contents) contains the string "test". (3 Replies)
Discussion started by: daflore
3 Replies
6. UNIX for Dummies Questions & Answers
Hello,
I'm using rhel6. Using File Browser Nautilus 2.28.4 I could easily locate any file I'm interested in by it name.
I'd like to use this File Browser to locate the file name based on it content e.g. based on some word in the text file.
It doesn't work for me that way ...
My question: does... (0 Replies)
Discussion started by: susja
0 Replies
7. Shell Programming and Scripting
Have to read one file say sourcefile containing several words and having another folder containing several files.
Now read the first word of Sourcefile & search it into the folder consisting sevral files, and create another file with result. We hhave to pick the filename of the file in which... (3 Replies)
Discussion started by: mukesh.baranwal
3 Replies
8. Shell Programming and Scripting
I have some users in one unix system and i want to search some files with specific to user and then i want to find some content inside that file so can u help me how we can implement it?
File location is as below.
/pools/home_unix/cmadireddy/work/models/model/
cmadireddy is user name.
now... (6 Replies)
Discussion started by: lathigara
6 Replies
9. Shell Programming and Scripting
I have two files:
file 1:
hello.com neo.com,japan.com,example.com
news.net xyz.com, telecom.net, highlands.net, software.com
example2.com earth.net, abc.gov.uk
file 2:
neo.com
example.com
abc.gov.uk
file 2 are the search keys to search in file 1 if any of the search key is... (3 Replies)
Discussion started by: csim_mohan
3 Replies
10. Shell Programming and Scripting
Hi,
I have a file with complex data without delimiter, have requirement to fetch the specific record based on some charcters.
here is my file data
... (12 Replies)
Discussion started by: Riverstone
12 Replies
LEARN ABOUT DEBIAN
config::model::treesearcher
Config::Model::TreeSearcher(3pm) User Contributed Perl Documentation Config::Model::TreeSearcher(3pm)
NAME
Config::Model::TreeSearcher - Search tree for match in value, description...
VERSION
version 2.021
SYNOPSIS
use Config::Model ;
use Log::Log4perl qw(:easy) ;
Log::Log4perl->easy_init($WARN);
# define configuration tree object
my $model = Config::Model->new ;
$model ->create_config_class (
name => "MyClass",
element => [
[qw/foo bar/] => {
type => 'leaf',
value_type => 'string'
},
baz => {
type => 'hash',
index_type => 'string' ,
cargo => {
type => 'leaf',
value_type => 'string',
},
},
],
) ;
my $inst = $model->instance(root_class_name => 'MyClass' );
my $root = $inst->config_root ;
my $step = 'baz:fr=bonjour baz:hr="dobar dan" foo="journalled"';
$root->load( step => $step ) ;
my @result = $root->tree_searcher(type => 'value')->search('jour');
print join("
",@result),"
" ;
# print
# baz:fr
# foo
DESCRIPTION
This class provides a way to search the content of a configuration tree. Given a keyword or a pattern, the search method will scan the
tree to find a value, a description or anything that match the given pattern (or keyword).
Constructor
new (type => [ value | description ... ] )
Creates a new searcher object. The "type" parameter can be:
element
value
key
summary
description
help
all Search in all the items above
Methods
search(keyword)
Search the keyword or pattern in the tree. The search is done in a case insensitive manner. Returns a list of path pointing to the matching
tree element. See "grab(...)" in Config::Model::AnyThing for details on the path syntax.
BUGS
Creating a class with just one search method may be overkill. OTOH, it may be extended later to provide iterative search.
AUTHOR
Dominique Dumont, (ddumont at cpan dot org)
SEE ALSO
Config::Model, Config::Model::SearchElement, Config::Model::AnyThing
perl v5.14.2 2012-11-09 Config::Model::TreeSearcher(3pm)