I need to copy all of the lines that contain "www.thisdomain.com" from the log and output them into a new file. I've tried everything with little luck. Please help and thanks!
This is assuming it's an already static log file and you aren't "scraping" a file that's being written to at all times.
Hi all,
I'm new to shell scripting.
I want to copy initial few lines(say first 10 lines) from a file to another file.
There is no "head" command in our embedded system.
sed & awk is there which I believe will do that, but I dont know how to.
This is linux 2.6 (embedded)
So please help me.... (5 Replies)
Hi all,
I'm new to shell scripting.
I want to copy the first N lines from a file to another file.
Can someone please tell me how this can be done.
Thanks
Himi (2 Replies)
how to copy lines from a log file based on timestamp.
INFO (RbrProcessFlifoEventSessionEJB.java:processFlight:274) - E_20080521_110754_967: rbrAciInfoObjects listing complete!
INFO (RbrPnrProcessEventSessionEJB.java:processFlight:197) - Event Seq: 1647575217; Carrier: UA; Flt#: 0106; Origin:... (1 Reply)
Hi All,
I have a file that gives me new line/output every 5 minutes. I need to create a script that capture new line/output besides "IN CRON_STATUS", in this case the new output is "begin ------ cron_status.sh - -----------".
I want this script to capture the line starting from "begin ------... (0 Replies)
Hi,
I have log file like this:
i want grep the log file without blank lines in column 4. So the file is become like this :
What is the command?
please help me. (1 Reply)
Hello,
I have a text file which I need to check for presence of certain tags, and then copy a subsequent portion of text into another file. The tag matching canbe done with Grep but I do not know how to copy selective lines from one file to another. Is it possible do that?
I checked up some... (8 Replies)
Hi Guys,
I have the following problem. I have original file (org.txt) that looks like this
module v_1(.....)
//arbitrary number of text lines
endmodule
module v_2(....)
//arbitrary number of text lines
endmodule
module v_3(...)
//arbitrary number of text lines
endmodule
module... (6 Replies)
Hi Guys,
I have an awk script that would search the input file for line that starts with a number 3 and copies into a new text file.
I want to extend this script to find the lines that either starts with 3 or a or b and copy all those lines into the new file.
Here is what I have so far:... (1 Reply)
Dear all,
I have stuck with this problem for some days.
I have a very big file, this file can not open by vi command.
There are 200 loops in this file, in each loop will have one line like this:
GWA quasiparticle energy with Z factor (eV)
And I need 98 lines next after this line.
Is... (6 Replies)
OS : RHEL 7.2
Shell : bash
I have a file which has lines like below
I want to copy from 2nd line to the 6th line and copy(redirect) those lines to another file.
$ cat patterns.txt
hello world
hello asia
hello europe
hello africa
hello america
hello antartica
hello... (9 Replies)
Discussion started by: omega3
9 Replies
LEARN ABOUT MINIX
grep
GREP(1) General Commands Manual GREP(1)NAME
grep - search a file for lines containing a given pattern
SYNOPSIS
grep [-elnsv] pattern [file] ...
OPTIONS -e-e pattern is the same as pattern
-c Print a count of lines matched
-i Ignore case
-l Print file names, no lines
-n Print line numbers
-s Status only, no printed output
-v Select lines that do not match
EXAMPLES
grep mouse file # Find lines in file containing mouse
grep [0-9] file # Print lines containing a digit
DESCRIPTION
Grep searches one or more files (by default, stdin) and selects out all the lines that match the pattern. All the regular expressions
accepted by ed and mined are allowed. In addition, + can be used instead of * to mean 1 or more occurrences, ? can be used to mean 0 or 1
occurrences, and | can be used between two regular expressions to mean either one of them. Parentheses can be used for grouping. If a
match is found, exit status 0 is returned. If no match is found, exit status 1 is returned. If an error is detected, exit status 2 is
returned.
SEE ALSO cgrep(1), fgrep(1), sed(1), awk(9).
GREP(1)