from small one page howto to huge articles all in one place
 

search text in:




Other .linuxhowtos.org sites: www.linuxhowtos.org
toolsntoys.linuxhowtos.org



Last additions:
How to make X listen on port 6000

How to make X listen on port 6000

words:

34

views:

54696

userrating:

average rating: 1.5 (4 votes) (1=very good 6=terrible)


May, 25th 2007:
April, 26th 2007:
Apr, 10th. 2007:
Druckversion . pdf icon
You are here: Tips&Tricks

Comparing Files

Often people compare the differences between two files using diff. But if you needed to do a comparison of similarities between files, comm is the command to use.

Code Listing 1: comm usage syntax

comm [option]  file1  file2

Note: both file1 and file2 need to be sorted before using comm as it does a line by line comparison.

comm outputs three columns: lines that are unique to file1, lines that are unique to file2, and lines that are common to both files. The options '-1', '-2', '-3' will suppress the corresponding columns.

Running comm -2 file1 file2 with the following files, would output five.

Code Listing 2: comm output

File1: 
one 
two 
three 
 
File2: 
one 
five 
three

From http://www.gentoo.org/news/en/gwn/20040823-newsletter.xml


rate this article:
current rating: no votes yet
Your rating:
Very good (1) Good (2) ok (3) average (4) bad (5) terrible (6)

back



Other free services
toURL.org
Shorten long
URLs to short
links like
http://tourl.org/2
tourl.org
.
Reverse DNS lookup
Find out which hostname(s)
resolve to a
given IP or other hostnames for the server
www.reversednslookup.org

New Packages

- as rdf newsfeed
- as rss newsfeed
- as Atom newsfeed
2020-01-28
2020-01-27
rdf newsfeed | rss newsfeed | Atom newsfeed
- Powered by LeopardCMS - Running on Gentoo -
Copyright 2004-2018 Sascha Nitsch Unternehmensberatung UG(haftungsbeschänkt)
Valid XHTML1.1 : Valid CSS : buttonmaker
- Level Triple-A Conformance to Web Content Accessibility Guidelines 1.0 -
- Copyright and legal notices -
Time to create this page: 37.0 ms