Hi,
I'm trying to make a grep to see if exists occurrences with a sentence like these:
grep -qi "message" file0 | grep -i $date | grep -vi "exception"
echo $?
1
If I execute without -q modifier I can find occurrences.
Someone could help me please?
Thanks and sorry for my English! (1 Reply)
Hello,
I'm trying to figure out how to speed up the following as I want to use multiple commands to search thousands of files.
is there a way to speed things up?
Example I want to search a bunch of files for a specific line, if this line already exists do nothing, if it doesn't exist add it... (4 Replies)
Hi,
I have a number of files containing the information below.
"""""
Fundallinfo
6.3950 14.9715 14.0482
"""""
I would like to grep for Fundallinfo and use it to read the next line? I ideally would like to read the three numbers that follow in the next line and... (2 Replies)
here is what i want to achieve.. i have a file with below contents
cat fileName
blah blah blah
.
.DROP this
REJECT that
.
--sport 7800 -j REJECT --reject-with icmp-port-unreachable
--dport 7800 -j REJECT --reject-with icmp-port-unreachable
.
.
.
more blah blah blah
--dport 3306... (14 Replies)
I'm new to using sed and grep commands, but have found them extremely useful. However I am having a hard time figuring this one out:
Delete every line containing the word CEN and the next line as well.
ie. test.txt
blue
324 CEN
green
red
blue
324 CEN
green
red
blue
to produce:... (2 Replies)
STEP 1
# Set variable
FILE=/tmp/mainfile
SEARCHFILE =/tmp/searchfile
# THIS IS THE MAIN FILE.
cat /tmp/mainfile
Interface Ethernet0/0 "outside", is up, line protocol is up
Hardware is i82546GB rev03, BW 100 Mbps
Full-Duplex(Full-duplex), 100 Mbps(100 Mbps)
MAC address... (6 Replies)
Hi all,
Would like to know how I could search for a string 'xyz' but have the output show the line plus the line above and/or below all lines found.
eg. search for xyz from file containing:
abc
12345
asdf xyz asdfds
wwwww
kjkjkj
ppppp
kkkxyz
eeee
zzzzz
and the output to... (2 Replies)