10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Linux version : Oracle Linux 6.5
Shell : bash
In the the below text file (someString.text), I want to grep all lines with .sh in it. ie. Only the lines mysript.sh and anotherscript.sh should be returned.
My below attempts failed.
I gather that in regular expression world, dot (.) is the... (3 Replies)
Discussion started by: John K
2. Shell Programming and Scripting
I need help to grep a specific part of a log file (bold).
24/2/2017-16:57:17.056 frosti-1 M3UA-Tx: }
24/2/2017-16:57:17.056 frosti-1 M3UA-Tx: extensionContainer <Not Present>
24/2/2017-16:57:17.056... (8 Replies)
Discussion started by: vasil
3. Shell Programming and Scripting
I am trying to grep search a pattern and a line before it.
When I use, grep with -o option and either of -A/B/C options, I still can't see lines before or after the pattern. But the exact pattern is... (5 Replies)
Discussion started by: jacobs.smith
4. UNIX for Dummies Questions & Answers
Thanks for taking the time to view this!
I want to grep out all lines of a file that starts with pattern 1 but also does not match with the second pattern.
Drink a soda
Eat a banana
Eat multiple bananas
Drink an apple juice
Eat an apple
Eat multiple apples
I... (8 Replies)
Discussion started by: demmel
5. Shell Programming and Scripting
I am trying to fetch lines before a pattern, I got to know about -B flag in grep but we have to pass the number to get those lines before some pattern say (X), now what if I want to get line/s with some other pattern say (Y) before X pattern? How to get about it? please help.
Input:... (5 Replies)
Discussion started by: dips_ag
6. Shell Programming and Scripting
Hi I need to grep for a patter and display all lines below the pattern.
For ex: say my file has the below lines
I NEED to grep for patter file3 and display all lines below the pattern. do we have an option to get this data. Let me know if you require... (5 Replies)
Discussion started by: venkidhadha
7. Shell Programming and Scripting
I have got the below requirement. please suggest.
I have a file like,
Processing Item is:
Processing Item is:
I want to process the above file to get the output file like,
... (5 Replies)
Discussion started by: rbalaj16
8. Shell Programming and Scripting
I am looking for a quick solution for this:
I have many log files of an iterative program, and I would like to display the parameters of the last three iteration from each of those files. Relevant lines have the keyword: ITER
I am using:
tac ~/modeling*/fitting.log | grep -m 3 -e... (2 Replies)
Discussion started by: pnemeth
9. Shell Programming and Scripting
i would like to get the above and below lines of the grep pattern .
For ex :
file as below:
my search pattern is date : 1-Nov
i need the o/p as below
1-Nov (6 Replies)
Discussion started by: expert
10. Shell Programming and Scripting
When i grep for a pattern the search results comes up with matching lines(some before the pattern and some after)...how can i limit the search so that it shows only the lines after the pattern specified (5 Replies)
Discussion started by: wannalearn