Prev: No internet from SuSE 11.3
Next: Compatibility of software between different Linuxdistributions/versions?
From: no.top.post on 27 Jul 2010 00:33 Someone kindly provided the following very useful one-liner to find all <recent> files containing 'a string':- find ./ -ctime -2 -exec grep -l "a string" {} \; Now I want command/s to find files containing MULTIPLE strings like: "dog", "cat", "fish" == TIA
From: Robert Riches on 27 Jul 2010 00:50 On 2010-07-27, no.top.post(a)gmail.com <no.top.post(a)gmail.com> wrote: > Someone kindly provided the following very useful one-liner > to find all <recent> files containing 'a string':- > > find ./ -ctime -2 -exec grep -l "a string" {} \; > > Now I want command/s to find files containing MULTIPLE strings like: > "dog", "cat", "fish" > >== TIA Is egrep what you're looking for? -- Robert Riches spamtrap42(a)jacob21819.net (Yes, that is one of my email addresses.)
From: root on 27 Jul 2010 02:47 no.top.post(a)gmail.com <no.top.post(a)gmail.com> wrote: > Someone kindly provided the following very useful one-liner > to find all <recent> files containing 'a string':- > > find ./ -ctime -2 -exec grep -l "a string" {} \; > > Now I want command/s to find files containing MULTIPLE strings like: > "dog", "cat", "fish" > >== TIA > Use egrep: egrep -l "dog\|cat\|fish" {}
From: Helmut Hullen on 27 Jul 2010 02:59 Hallo, root, Du meintest am 27.07.10: >> Someone kindly provided the following very useful one-liner >> to find all <recent> files containing 'a string':- >> >> find ./ -ctime -2 -exec grep -l "a string" {} \; >> >> Now I want command/s to find files containing MULTIPLE strings like: >> "dog", "cat", "fish" > Use egrep: > egrep -l "dog\|cat\|fish" {} Sorry - doesn't work here. egrep -l "\(dog\|cat\|fish\)" * works, but find . -exec egrep -l "\(dog\|cat\|fish\)" {} \; doesn't work. Viele Gruesse Helmut "Ubuntu" - an African word, meaning "Slackware is too hard for me".
From: Joost Kremers on 27 Jul 2010 03:53 Helmut Hullen wrote: > Sorry - doesn't work here. > > egrep -l "\(dog\|cat\|fish\)" * > > works, but > > find . -exec egrep -l "\(dog\|cat\|fish\)" {} \; > > doesn't work. try find . -ctime -2 | xargs egrep -l "\(dog\|cat\|fish\)" -- Joost Kremers joostkremers(a)yahoo.com Selbst in die Unterwelt dringt durch Spalten Licht EN:SiS(9)
|
Next
|
Last
Pages: 1 2 3 4 Prev: No internet from SuSE 11.3 Next: Compatibility of software between different Linuxdistributions/versions? |