Skip to main content

Thread: grep question


hi, having problem...
want search files in directory couple of strings, use:

grep -irne string1 -e string2 -e string3 *

results sorted according strings being searech. want first lines containing string1, lines containing string2 , on...
can somehow done?
help.

why not run command 3 times , dump output in file, appending (>> rather >) second 2 results.

code:
grep -irne string1 * > grep.txt && grep -irne string2 * >> grep.txt && grep -irne string3 * >> grep.txt


Forum The Ubuntu Forum Community Ubuntu Official Flavours Support New to Ubuntu [ubuntu] grep question


Ubuntu

Comments

Popular posts from this blog

How to change text Component easybook reloaded *newbee* - Joomla! Forum - community, help and support

After Effect warning: A problem occurred when processing OpenGL commands

Preconditions Failed. - Joomla! Forum - community, help and support