I m kind of stuck ...i need to find files with a specific criteria but i can not make it work ....
These are the ones :
1.How do you Find files under /root that contain the whole words (i.e., not part of another word) 'foo', 'bar', 'baz', 'cat', 'cut', 'cot.' using a single command ?
I tried :find /root -name 'foo.*' -name 'baz.*'-name 'cat.*'-name 'cut.*'-name 'cot.*'
but seems that is not right
2.Find files under /var that contain the character list 'xxx' or 'xxxx' or 'xxxxx'. Using \{\} and adding two lines of context before AND after each keyword found. ..
my answer: find /var -name 'xxx' ,'xxxx, 'xxxxx'
At this point i am lost ....
Any help will be very much appreciated
These are the ones :
1.How do you Find files under /root that contain the whole words (i.e., not part of another word) 'foo', 'bar', 'baz', 'cat', 'cut', 'cot.' using a single command ?
I tried :find /root -name 'foo.*' -name 'baz.*'-name 'cat.*'-name 'cut.*'-name 'cot.*'
but seems that is not right
2.Find files under /var that contain the character list 'xxx' or 'xxxx' or 'xxxxx'. Using \{\} and adding two lines of context before AND after each keyword found. ..
my answer: find /var -name 'xxx' ,'xxxx, 'xxxxx'
At this point i am lost ....
Any help will be very much appreciated
Comment