Since your new at unix, you could have a look at the man pages of tail and head commands, for you could have used e.g.
maybe more accessible for a novice than having to assimilate sed (and awk) syntax, nevertheless you would have to use it in the same way as the bright example of sk1418 since diff wants 2 files in input you have to use "-" to say "Standard Input - to be used as file1"...
All,
How to exclude a directory while diff execution?
For ex:
To exclude file which we don't want to see diff, we have -x <filename>.
Thanks in advance (1 Reply)
i have 2 file named test1,test2
contents of test1:
1
2
3
---------------------------
contents of test2:
1
2
3
4
5
--------------------------------------------------------
my desired o/p should be:
diff test2 test1
4 (5 Replies)
Is there any option for the diff command (or maybe an entirely different command) that will give you only the text that differs between two files? When I use diff file1 file2, if any text on that line differs from one file to the next it'll print out the entire line. I'd like to see only the text... (2 Replies)
Hi all
diff file1 file 2
command will give us op of diff between two file. But it aslo give its position and sign "<" or ">". I dont want position and sign in op. Only diff of content should be come as op.
Kindly help me for this.
Regards
Jaydeep (1 Reply)
Hi Guys
I have a situation where I would like to use the diff command but I would like to see "number" of differences and than send it through and if statement and than view the difference if greater than 1.
Eg. diff file1 file2 > than gives the "number" and I than say -
if number >1... (3 Replies)
hi,
I have some problems in my simple script about the redirect echo stdout command inside a condition. Why is the echo command inside the elif still execute in the else command
Here are my simple script
After check on the two diff output the echo stdout redirect is present in two diff... (3 Replies)
Hello,
I am trying to find the different files between multiple directories in Linux, here is a small assumption of what is inside the directories
dir1 dir2 dir3
1.txt 1.txt 1.txt
2.txt 3.txt 3.txt
5.txt 4.txt 5.txt
6.txt 7.txt 8.txt
I am using the following... (4 Replies)
Platform :Oracle Linux 6.4
Shell : bash
In the below sample, although the lines in a.txt and b.txt are jumbled up, there is only one difference : b.txt has an extra line NETHERLANDS
$ cat a.txt
SPAIN
NORTH KOREA
PORTUGAL
GERMANY
SYRIA
$
$
$ cat b.txt
GERMANY
NORTH KOREA
SPAIN... (6 Replies)