Is there a way to grep for something and then print out 10 lines after it.
for example if I want to grep for a word, then output the following 10 or whatever number of lines after the word. (5 Replies)
Hi, I wonder if anyone can help me. I have a file with about 200 lines in it. I am wanting to set up a Count so that it picks out each line at turn and edits the line. However i am having trouble pulling out the specific line. I have a feeling it will be done somehow by a grep -n but what ever i... (2 Replies)
Hi All,
I am having a script in which I am greping some values and storing them from files with .err and .log extensions.
I feel I can do it better.But How?
Below is my piece of code.
oneerrors=`egrep -i -n "one" *.err *.log`
twoerrors=`egrep -i -n "two" *.err *.log` ... (2 Replies)
OKAY----
Here's what I must do.
I have two files. I need to compare the two files such as with the diff command. I am adding FILENEW to FILEOLD
If fields $1, $2, $5, and 6 are the same, then I don't want to add FILENEW records to FILEOLD.
If they are not, then append the lines.
Is... (11 Replies)
I have a log file and I have two unique strings which represent the start and end of the text I want to obtain.
How can I get all the text inbetween this start string and the end string?
Thanks (2 Replies)
Hi,
What is the easiest way to list a directory with 1000s of filenames, grep it for a certain sequence of numbers, and if found to rename the file by the value you are grepping.
eg
The file I am examining will looks like this:
1234
1224343
2324
244
35665
If I am examining a list... (1 Reply)
Hi All,
I need help to know the exact command when I grep large list of files. Either using ls or find command. However I do not want to find in the subdirectories as the number of subdirectories are not fixed. How do I achieve that.
I want something like this:
find ./ -name "MYFILE*.txt"... (2 Replies)
Dear Friends,
I am trying to move the files which are listing after greaping command.
see the details below
1. When i am running the grep command
$ grep -il 'Bufman' *.*
fatal.log
fatal_info.log
it has listed some files now i want to move this files to any another locate so i am... (13 Replies)
I have around 300 files(*.rdf,*.fmb,*.pll,*.ctl,*.sh,*.sql,*.prog) which are of large size.
Around 8000 keywords(which will be in the file $keywordfile) needed to be searched inside those files.
If a keyword is found in a file..I have to insert the filename,extension,catagoery,keyword,occurrence... (8 Replies)
Discussion started by: millan
8 Replies
LEARN ABOUT MINIX
diff
DIFF(1) General Commands Manual DIFF(1)NAME
diff - print differences between two files
SYNOPSIS
diff [-c | -e | -C n] [-br]file1 file2
OPTIONS -C n Produce output that contains n lines of context
-b Ignore white space when comparing
-c Produce output that contains three lines of context
-e Produce an ed-script to convert file1 into file2
-r Apply diff recursively to files and directories of
EXAMPLES
diff file1 file2 # Print differences between 2 files
diff -C 0 file1 file2
# Same as above
diff -C 3 file1 file2
# Output three lines of context with every
diff -c file1 file2 # Same
diff /etc /dev # Compares recursively the directories /etc and /dev
diff passwd /etc # Compares ./passwd to /etc/passwd
DESCRIPTION
the same name, when file1 and file2 are both directories" difference encountered"
Diff compares two files and generates a list of lines telling how the two files differ. Lines may not be longer than 128 characters. If
the two arguments on the command line are both directories, diff recursively steps through all subdirectories comparing files of the same
name. If a file name is found only in one directory, a diagnostic message is written to stdout. A file that is of either block special,
character special or FIFO special type, cannot be compared to any other file. On the other hand, if there is one directory and one file
given on the command line, diff tries to compare the file with the same name as file in the directory directory.
SEE ALSO cdiff(1), cmp(1), comm(1), patch(1).
DIFF(1)