LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-18-2004, 09:24 PM   #1
Frybyte
Member
 
Registered: Nov 2003
Location: Seattle in a hut
Distribution: Simply mepis and it's soooo nice !!!
Posts: 71

Rep: Reputation: 15
which should I use? diff cmp comm


Hello-
I have numerous files all containing some version of a libretto I am working on.
What I need is a printout that;
gives me line numbers *or* the text of each part that is different from each file.
What I have done is tried each of the commands
diff cmp and comm and
For the most part I can't get a handle on the output

So can anyone give me the command line to type that would result in what I need * printed* out via my printer?

Thanks
Jay
 
Old 07-19-2004, 01:25 AM   #2
this213
Member
 
Registered: Dec 2001
Location: ./
Distribution: Fedora, CentOS, RHEL, Gentoo
Posts: 167

Rep: Reputation: 34
comm -1 -3 oldfile newfile

will give different lines in newfile as compared to oldfile
ie, if oldfile contains:
one
two
three

and newfile contains:
one
five
three

output would be:
five
 
Old 07-19-2004, 08:22 AM   #3
AnanthaP
Member
 
Registered: Jul 2004
Location: Chennai, India
Distribution: UBUNTU 5.10 since Jul-18,2006 on Intel 820 DC
Posts: 832

Rep: Reputation: 200Reputation: 200Reputation: 200
Output redirection.

I think what you want is to redirect the output to a text file or printer like so:

comm -1 -3 oldfile newfile (or whatever) >> output.txt.

Now you can view output.txt at your liesure.

Alternatively.

comm -1 -3 oldfile newfile | lp will send the output directly to the default printer.

HTH

End
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
comm question webeye Programming 9 11-29-2005 12:49 AM
Comm 5 WillG SUSE / openSUSE 3 09-04-2005 10:16 PM
usb serial comm guyulmaz Mandriva 3 06-07-2005 01:20 AM
Help me where to find 'cmp' sohard2reg Amigo 1 03-19-2005 02:54 AM
Dual Boot diff Hard Disk diff OS on Suse 9.1 wilhem Linux - Newbie 1 08-13-2004 06:06 PM


All times are GMT -5. The time now is 05:57 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration