![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| grepping columns | ScKaSx | UNIX for Dummies Questions & Answers | 8 | 02-29-2008 06:44 PM |
| Grepping issue.. | LinuxRacr | Shell Programming and Scripting | 9 | 02-28-2008 12:26 PM |
| Grepping for strings | t4st33@mac.com | UNIX for Dummies Questions & Answers | 5 | 06-20-2007 11:51 PM |
| grepping for a sentence | eloquent99 | UNIX for Dummies Questions & Answers | 2 | 04-23-2003 02:40 PM |
| grepping | eloquent99 | UNIX for Dummies Questions & Answers | 5 | 04-22-2003 10:20 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
grepping around
Using shell scripts, I use grep to find the word “error” in a log file:
grep error this.log. How can I print or get the line 3 lines below the line that word “error” is located? Thanks in advance for your response. |
|
||||
|
Hi. I am a new user to this site. This is actually my first post.
My question is similar. How can I grep for a particular string and have grep return that string along with the next 10 lines beneath the grepped string? manas_ranjan said to issue grep -A <<n>> <<search pattern>> file_name, but it doesn't look like -A is a grep option on the Solaris 10 box I am trying to run the command on. I assume I should install the latest version of GNU grep, but I am not an admin of this box, so that is not an option.Are there alternatives such as awk/nawk or sed? If so, what would the exact commands be? Thanks you very much in advance. ![]() - LaLonde |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|