Comm is a UNIX utility used to compare two sorted files line by line. (For COMM ports, use tag "serial-port")
Questions tagged [comm]
137 questions
0
votes
0 answers
comm and variables not redirecting to file
I'm working on a bash script to store the difference of packages from day to day in a debian based system.
I am toying around with the code below to get the functionality down before I fine tune it and running into difficulty with the line
comm -1…

Not_A_Dolphin
- 25
- 5
0
votes
1 answer
Is the comm command broken on Mac?
Suppose there are file1:
1
2
3
5
And file2:
2
3
4
When comparing them with comm file1 file2 on FreeBSD or Linux, I got the following result:
1
2
3
4
5
But when I tried the same command on Mac OSX 10.9, the…

Domon
- 6,753
- 1
- 25
- 29
0
votes
0 answers
Finding non SIMILAR lines on Solaris (or Linux) in two files
I'm trying to compare 2 files on a Solaris box and only see the lines that are not similar. I know that I can use the command given below to find lines that are not exact matches, but that isn't good enough for what I'm try to do.
comm -12 <(sort…

zwy
- 1
- 2
0
votes
1 answer
Comm, awk alternative for php
I have 2 files:
images1.txt
--file1
--file2
--file5
--file6
--file7
images2.txt
--file1
--file5
--file6
I need to be created file images_to_delete.txt with expected result:
images_to_delete.txt
--file2
--file7
I know i could do this with bash using…

kostya572
- 169
- 2
- 21
0
votes
1 answer
Keep the content of a text with specific same columns in command line
Basically I tried to operate files in command line like this:
File1:
,1,this is some content,
,2,another content,
,3,blablabla,
,4,xxxxxxxx,
,5,yyyyyyyy,
,6,zzzzzzzzzz,
... ...
File2:
1
3
4
5
Now I want to keep the content of file1 with the…

Qingshan Zhang
- 245
- 1
- 3
- 12
0
votes
0 answers
comm implementation in Java ( comm -- select or reject lines common to two files )
I have 2 huge files. One of them contains original DB with transactions line by line sorted alphabetically, the second one contains an incremental DB also with transactions sorted alphabetically. What I need is to get all of the common transactions…

Ahmadov
- 1,567
- 5
- 31
- 48
-1
votes
1 answer
terminal, diff of two files, print out all lines, which are on the 2nd file a no on 1st file
On follow samples, every line can be empty or can have some characters. The characters can be other than numbers too. Every line can have line feeds and tabs too.
Follow looks partly fine, a don't work with more complex…

Alfred.37
- 181
- 1
- 12
-1
votes
3 answers
How to comparing two big files on unique strings using fgrep/comm?
I have two files. A file disk.txt contains 57665977 rows and database.txt 39035203 rows;
To test my script I made two example files:
$ cat…

Max Visser
- 577
- 4
- 10
-1
votes
1 answer
Comparing a column in two files in linux but print the other columns in the second file as well
File1.txt
phone_number
0777
0788
0789
0766
0756
File2.txt
phone_number name address
0777 Joe street1
0788 Karen street2
0789 Dave street3
0783 Sean street4
0781 Mick street5
Output…

danc90
- 1
- 1
-1
votes
1 answer
Shell - diff between files and parameters in each line
I am looking for advance two file compare shell/bash/php. Let say i have such files:
file1
.run file=test_script.sql rev=1.1
.run file=test_sql.sql rev=1.1
.run file=test_drop.sql rev=1.2
file2
.run file=test_drop.sql rev=1.2
.run…

Makaron
- 15
- 4
-1
votes
2 answers
Linux Comm Command
I'm sure this is an easy question but I'm just not understanding...
Ex.
cat file1.txt
abc
def
ghi
cat file2.txt
abc
ghi
klm
comm file1.txt file2.txt
So I know first column displays lines unique in file1
Second : lines…

halapgos1
- 1,130
- 4
- 16
- 34
-1
votes
4 answers
Bash script compare values from 2 files and print output values from one file
I have two files like…

Mr.Croot
- 9
- 1
-1
votes
2 answers
Find same words in two text files
I have two text files and each contains more than 50 000 lines. I need to find same words that are in both text files. I tried COMM command but I got answer that "file 2 is not in sorted order". I tried to sort file by command SORT but it doesn´t…

user1844845
- 281
- 3
- 7
- 15
-1
votes
1 answer
-2
votes
1 answer
Comm command issue
I'm trying to compare two gene lists and extract the common ones. I sorted my .txt files and used comm command:
comm gene_list1.txt gene_list2.txt
Strangely, when I check the output, there are many common genes that are not printed in the third…

Newcomer
- 47
- 1
- 1
- 5