2
votes
1answer
44 views

How do I use grep to find a text string in files in sub folders of a parent folder without -r switch

I'm using Solaris 10 and have two grep versions one in /usr/bin and one in /usr/xpg4/bin. I have been searching for an answer on how to search for text within files within sub folders of a parent ...
3
votes
2answers
75 views

how to grep complex hierarcy?

I have a file as:- start apple 1 a 2 b 3 c start orange 4 a 5 b start mango 1 a start a/b/c 5 z end 4 b end 6 c end start banana 3 c end 4 d 5 e end I want the output as :- 1 apple/a 2 apple/b 3 ...
0
votes
1answer
3k views

How do I redirect output from the find command (that uses grep) to a log file?

Consider the code to search for all files containing the pattern "search string": bash-3.2$ # The below find works fine.. bash-3.2$ find . -type f -exec grep -il "search string" {} \; bash-3.2$ # But ...
1
vote
2answers
689 views

linux + match IP ADDRESS with 3 octets or with 4 octets

how to match IP address with 4 octets or with 3 octets in one command? target - match xxx.xxx.xxx or xxx.xxx.xxx.xxx ( syntax should fit for Linux and Solaris ) how to merge the following commands ...
1
vote
1answer
764 views

How to properly use /usr/xpg4/bin/grep -F

I have a problem producing filtering out hanzoMollusc (2)from my grep. https://node.hanzo.com/production/application/ (1) https://node.hanzoMollusc.com/Messaging/Receiver (2) My grep command is ...
1
vote
1answer
207 views

solaris + fit egrep for solaris

On Linux machines I use this syntax, in order to match all VALID ip's. My question: what needs to change for egrep command in order to run the egrep on Solaris? According to egrep manual page "-o" ...
2
votes
3answers
4k views

solaris 10 + display 2 lines after match by grep?

I want to match for example: The string e1000g0 from the lltconfig -a list , and then to display the two lines after the string e1000g0 so I get only the lines: Node 0 du1a : ...
4
votes
6answers
5k views

Recursive search doesn't work for grep on solaris

On our Solaris server I'm finding that grep -r doesn't work, which is the usual way that I use grep. It seems that egrep has the same behavior. Given that I have no control over the machine, is there ...
4
votes
2answers
2k views

Using grep -v on multiple arguments

Is there a simpler way to do this? grep -v foo file | grep -v bar There're probably very elegant ways to do it with egrep, but how to go with plain old grep? EDIT: grep -v 'foo\|bar' file seems to ...