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:

89159

userrating:

average rating: 1.2 (52 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

back



Support us on Content Nation

New Packages

- as rdf newsfeed
- as rss newsfeed
- as Atom newsfeed
2026-10-14
2026-10-13
awscli - 2.37.13
Ebuild name:

app-admin/awscli-2.37.13

Description

Universal Command Line Environment for AWS

Added to portage

2026-10-13

cpp-httplib - 0.60.1
Ebuild name:

dev-cpp/cpp-httplib-0.60.1

Description

C++ HTTP/HTTPS server and client library

Added to portage

2026-10-13

haskell-mode - 17.4
Ebuild name:

app-emacs/haskell-mode-17.4

Description

Mode for editing (and running) Haskell programs in Emacs

Added to portage

2026-10-13

mycli - 2.29.4
Ebuild name:

dev-db/mycli-2.29.4

Description

CLI for MySQL Database with auto-completion and syntax highlighting

Added to portage

2026-10-13

opentmux - 0.1
Ebuild name:

app-misc/opentmux-0.1

Description

Terminal multiplexer, slop-free fork of app-misc/tmux

Added to portage

2026-10-13

opentmux - 9999
Ebuild name:

app-misc/opentmux-9999

Description

Terminal multiplexer, slop-free fork of app-misc/tmux

Added to portage

2026-10-13

yq - 4.4.5
Ebuild name:

app-misc/yq-4.4.5

Description

Command-line YAML processor - jq wrapper for YAML documents

Added to portage

2026-10-13

rdf newsfeed | rss newsfeed | Atom newsfeed
Copyright 2004-2025 Sascha Nitsch Unternehmensberatung GmbH
- Copyright and legal notices -
Time to create this page: 34.5 ms