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)
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)
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)
If a file consists of a thousands of line. There is a error line in the file which exists just before the line with word "Manish".
How could I write a script to grep the line with error.
Ex:-
If I have a UNIX file which contains the following:
bash-3.2$ cat unix.txt
Unix (officially... (4 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)
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)
I have a file that includes strings with special characters, eg
file1
line: 1 - special 1
line: = 4
line; -3
etc
How can I grep the lines of file1 from file2, line by line?
I used fgrep and egrep to grep a particular line and worked fine, but when I used:
cat file1|while read line;do... (2 Replies)
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'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)
Discussion started by: mierdatuti
1 Replies
LEARN ABOUT MOJAVE
ethcheck
ETHCHECK(8) BSD System Manager's Manual ETHCHECK(8)NAME
ethcheck -- check the integrity of Broadcom Ethernet devices' firmware.
SYNOPSIS
ethcheck --integrity-check [-b filename]
ethcheck --show-hashes [-b filename]
ethcheck --save -b filename
ethcheck --cleanup -b filename
ethcheck --version
ethcheck --help
DESCRIPTION
Ethcheck is an application-layer tool to check the integrity of Broadcom Ethernet devices' firmware.
The following commands can be used with ethcheck:
--integrity-check attempt to automatically determine which firmware you are running, integrity check against the appropriate file, and report
the check result. It requires root privileges.
--integrity-check -b filename integrity check the firmware image, and report the check result.
--show-hashes print the hashes for the current system's Ethernet devices' firmware to stdout. It requires root privileges.
--show-hashes -b filename print the hashes for the given firmware image to stdout.
--save -b filename save this Ethernet device(s)'s firmware in file. It requires root privileges. File name(s) will begin with specificed
filename and be selected according to device ID(s), machine model name, and firmware's version(s). E.g. filename-eth0-0x14e4-0x1686.nvram.bin
--cleanup -b filename zero any privacy-sensitive data (such as MAC address), enabling the file to be shared for analysis.
--version print out ethcheck version number.
--help display a short help.
May 25, 2017