Re: Commmand to find a string in a text file ...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 






try grep.
I dont think that you can tell it to grep x lines, but you can define
delimiters (for example a paragraph with -p, the delimiter would
be a blank line).

If you need an exact number of lines you could get the line number
where grep found something and make a script to cut those
parts.

--Orm

>I'm looking for a command or a script that is able to find a string in a
text file.
>But I want to display for example 10 lignes before the string, I search,
and 10
>lignes after.


-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.rutgers.edu


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux