New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Development and Darwin Discussion and questions about development for Mac OS X.

"diff" command


Post Reply New Thread Subscribe

 
Thread Tools
y2j164

 
Member Since: Apr 19, 2010
Posts: 2
y2j164 is on a distinguished road

y2j164 is offline
Is there anyway to run diff on terminal to find identical data. For example let's say I have two files of e-mails. My boss wants me to find which e-mails overlap in both files. How do i run this diff in terminal?
QUOTE Thanks
bobtomay

 
bobtomay's Avatar
 
Member Since: Dec 22, 2006
Location: Texas, where else?
Posts: 25,054
bobtomay has a reputation beyond reputebobtomay has a reputation beyond reputebobtomay has a reputation beyond reputebobtomay has a reputation beyond reputebobtomay has a reputation beyond reputebobtomay has a reputation beyond reputebobtomay has a reputation beyond reputebobtomay has a reputation beyond reputebobtomay has a reputation beyond reputebobtomay has a reputation beyond reputebobtomay has a reputation beyond repute
Mac Specs: 15" MBP 2.33 C2D 256 4GB, MBA 13" i7 1.8, MB 2.0 2GB, Nano 4th, 3GS, iPad 1

bobtomay is offline
Moved post to it's own thread. Please don't post new questions on unrelated 3 yr old threads. People tend to notice that when they open it up and pass on responding. Thanks

Sorry, can't help... I'm one of thise GUI types.

I cannot be held responsible for the things that come out of my mouth.
In the Windows world, most everything folks don't understand is called a virus.
QUOTE Thanks
xstep

 
xstep's Avatar
 
Member Since: Jun 25, 2005
Location: On the road
Posts: 3,231
xstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to all
Mac Specs: 2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid

xstep is offline
Have to assume you are running some kind of script. Check $status immediately upon return. Also, I think you'll want to use '-q' to limit differences that are spit out, and send any output to /dev/null.

CameraTime - Time lapse photography for novice and advanced users.

When asking questions, post the version of your software. You'll receive better answers.

Please post your results to the thread as it is good feedback.
QUOTE Thanks
Bill McEnaney

 
Member Since: May 27, 2010
Posts: 21
Bill McEnaney is on a distinguished road

Bill McEnaney is offline
That's easy if I understand your question. In a Terminal window, type "diff" and then the names of the files you want the computer to compare. For example, if you want to compare the contents of two text files you can write something like this: "diff telegram.txt letter.txt". If the files differ, the computer will tell you about the first difference it finds. If the files are the same, it won't say anything about them. To compare files side by side, use sdiff instead of diff.

Naturally, you probably won't use the quotation marks when you type the command. But you will need quotation marks if your file names contain spaces.

Quote:
Originally Posted by y2j164 View Post
Is there anyway to run diff on terminal to find identical data. For example let's say I have two files of e-mails. My boss wants me to find which e-mails overlap in both files. How do i run this diff in terminal?
QUOTE Thanks

Post Reply New Thread Subscribe


« An IDE for Prolog | I Want to be a Apple Developer! »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
How to do highlight command in Preview? seacucumber OS X - Apps and Games 8 09-29-2009 01:15 PM
need help with afconvert command nick_harambee OS X - Operating System 0 09-05-2009 05:25 AM
Use Applescript to run a terminal command Turk182 OS X - Development and Darwin 1 02-12-2009 12:08 PM
command + del not working w/ ext. keyboard markameeks Apple Notebooks 1 12-05-2008 04:22 PM
UNIX command to find out process hook walkerj Switcher Hangout 0 04-23-2005 04:22 PM

All times are GMT -4. The time now is 12:45 PM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?