Diff on 1gb files


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Diff on 1gb files
# 1  
Old 10-22-2012
Diff on 1gb files

Hey Guys,
I have a scenario to compare two different files which are of size 1gb each. I need to get the uncommon lines. I planned to use sdiff command, which generally works perfect for me. But in this case am facing a error saying

"diff: memory exhausted"
Can anyone please explain this.

Also, can anyone suggest a unix command to compare huge files, to get the common and the uncommon lines between the two files.

Thanks,
Abhishek S.
# 2  
Old 10-22-2012
try:
Code:
cmp file1 file2

# 3  
Old 10-22-2012
Use the command
Quote:
comm
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Diff 3 files, but diff only their 2nd column

Guys i have 3 files, but i want to compare and diff only the 2nd column path=`/home/whois/doms` for i in `cat domain.tx` do whois $i| sed -n '/Registry Registrant ID:/,/Registrant Email:/p' > $path/$i.registrant whois $i| sed -n '/Registry Admin ID:/,/Admin Email:/p' > $path/$i.admin... (10 Replies)
Discussion started by: kenshinhimura
10 Replies

2. UNIX for Dummies Questions & Answers

How do I find files which are older than 30 days and greater than 1GB

Hi All, I know the separate commands for finding files greater than 30 days and finding files greater than 1GB. How do I combine these two commands? Meaning how do I find files which are > 1GB and older than 30 days? ;) (4 Replies)
Discussion started by: Hangman2
4 Replies

3. Shell Programming and Scripting

.procmailrc and uudeview (put attachments from diff senders to diff folders)

Moderator, please, delete this topic (1 Reply)
Discussion started by: optik77
1 Replies

4. Shell Programming and Scripting

diff bw two files

Hi All, I have two files which look as below File1 serial="1" name="abc" type="employee" field="IT" serial="2" name="cde" type="intern" field="Marketing" serial="3" name="pqr" type="contractor" field="IT" serial="4" name="xyz" type="employee" field="Sales" File2 serial="1"... (3 Replies)
Discussion started by: grajp002
3 Replies

5. Shell Programming and Scripting

diff of files

Hi, I have 2 files.I want to check if file1 is contained in file2. A.txt: ----- AAA BBB B.txt: ------ CCC AAA BBB DDD I want to check if A.txt is contained in B.txt. Can it be done using SED ? (12 Replies)
Discussion started by: giri_luck
12 Replies

6. Red Hat

1Gb+ memory problem

Hi, I have a Linux distribution ( Oralce Enterprise Linux 5.3 i.e. Redhat ) that I have installed. It works fine when I used 2*512Mb dimms or replace them with a single 1Gb dimm. However when I try to go above 1 Gb the bootup and general performance deteriorates badly. The BIOS picks up the memory... (3 Replies)
Discussion started by: jimthompson
3 Replies

7. Shell Programming and Scripting

Diff b/w 2 files

Hi Masters, I have two files named file1 and file2. Both the files contains the same contents with some difference in comments,space.But no content change. I tried to find the diff between the two files to make sure that contents are same. For that i tried diff -ibw file1 file2 But... (1 Reply)
Discussion started by: ecearund
1 Replies

8. Shell Programming and Scripting

Find duplicates from multuple files with 2 diff types of files

I need to compare 2 diff type of files and find out the duplicate after comparing each types of files: Type 1 file name is like: file1.abc (the extension abc could any 3 characters but I can narrow it down or hardcode for 10/15 combinations). The other file is file1.bcd01abc (the extension... (2 Replies)
Discussion started by: ricky007
2 Replies

9. UNIX for Advanced & Expert Users

ZIP file with 1GB or more

Hi, I have to do a search on a zip files whose sizes vary from 1GB to 1.5GB. I dont want to unzip it since if it goes beyond 2GB....... also will unzip -p filename | grep create any problems, will it unzip the whole file or will it unzip it piece by piece?? I appreciate your inputs... ... (1 Reply)
Discussion started by: baanprog
1 Replies

10. Shell Programming and Scripting

diff 2 files; output diff's to 3rd file

Hello, I want to compare two files. All records in file 2 that are not in file 1 should be output to file 3. For example: file 1 123 1234 123456 file 2 123 2345 23456 file 3 should have 2345 23456 I have looked at diff, bdiff, cmp, comm, diff3 without any luck! (2 Replies)
Discussion started by: blt123
2 Replies
Login or Register to Ask a Question