Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [comm]

The tag has no usage guidance.

0
votes
4answers
86 views

Need identical lines from file2 which are present in file1

File1 contains numbers each per line (0 to 9 digit length) total records 20k File2 contains numbers(0 to 9 digit) in first column and other info in each line,total recs 46 ,000,00 Both files are ...
2
votes
1answer
60 views

bash remove common lines from two files

I have two files, (no blank lines/Spaces/Tabs) /tmp/all aa bb cc hello SearchText.json xyz.txt /tmp/required SearchText.json and the end output I want is : (all uncommon lines from /...
1
vote
4answers
103 views

How to find the intersection of multiple files (not necessarily two files)?

I'd like to write a simple script for finding the intersection of multiple files (the common lines among all files), so after reading some here (link) i tried to write a bash script, which ...
0
votes
1answer
43 views

Can I merge-sort two sorted files by using comm?

comm assumes its two inputs are sorted. Is it correct that it works in the same way as the merge sort algorithm? If yes, can I use comm to merge-sort two sorted files? Thanks.
-3
votes
2answers
89 views

What do comm and diff try to accomplish at input/output level?

Given two files, for each line in each file, how do comm and diff determine whether the line also occur in the other file? if it does, whether its occurrences in the two files are the same or ...
0
votes
1answer
42 views

Printing in one line the common text using comm cmd?

I have 2 files that contain numbers_ID, status, descrpation I want to join both files based on the numbers as number_123, status1, status2 My file 1: number_123,this car is under maintenance ...
0
votes
1answer
36 views

Print only what is exclusive to a file compared to another in Bash

Good day everyone, I know there are a lot of similar questions already answered, but I can't find a satisfying answer and it drives me nuts. I have two files which both contain hostnames : one that ...
1
vote
3answers
1k views

Linux equivalent of windows cmd command

I'm migrating to Linux, and I need to convert the following Windows cmd command: fc file1.txt file2.txt | find /i "no se han encontrado diferencias" > nul && set equal=yes I think fc can ...
0
votes
2answers
43 views

Comparing Data between 2 different files in Unix

I have 2 different files- File 1 2 4 6 8 10 12 File 2 2 3 5 6 10 12 I want to compare 2 files and get the output data which is in File 1 but not in File 2- Output 4 8 I am using below command ...
1
vote
1answer
102 views

Using comm with NULL-terminated records

Over in an answer to a different question, I wanted to use a structure much like this to find files that appear in list2 that do not appear in list1: ( cd dir1 && find . -type f -print0 ) | ...
1
vote
1answer
741 views

comm command behaving strangely

I have two files: one generated using find command in a folder to list files, sorting them numerically and writing to a file, and the other generated by a python script, which is not sorted, so I ...
0
votes
1answer
2k views

compare 2 csv files and output only difference into variable

1.csv: rundeck-read-only-iam-permissions,IAMReadOnlyAccess citrix-xendesktop-ec2-provisioning",AmazonEC2FullAccess 2.csv: citrix-xendesktop-ec2-provisioning",AmazonEC2FullAAA citrix-xendesktop-ec2-...
0
votes
1answer
77 views

How to use comm to match log files with same elements, but different timestamps?

I'm trying to use the comm command to compare two logs to see which apps have been installed but not removed. I don't want to use awk for this, if possible. Here's and example of the files: Installed:...
0
votes
2answers
345 views

comm is not proving expected result

I have couple of files (file 1.txt and file2.txt) and I am using unix "comm" command to compare those files to find out unique lines on file1.txt Here are the lines having on file1.txt: OD1 EN2 OD3 ...
1
vote
1answer
295 views

Removing lines in LARGE text file containing string found in other LARGE text file - FILES SORTED

Still having issues trying to remove lines in a LARGE file containing strings listed in another LARGE file. grep -vwFf file1 file2 - FAILS due to memory exhaustion. I have used: comm -23 file1 ...
0
votes
1answer
971 views

How can I use comm in this way?

From my understanding I want to use comm -23 file1 file2. file1 is the result of find and file2 is cut -c43- list. Is it possible I can write this as 1 line and not use any files (except the one I ...
1
vote
1answer
109 views

Why does the output of comm fail to show common records?

I have a list of IDs (sorted) in two files and I ran the comm command to compare them, but it seems to miss out one lines common to both files. Why is that? File1: 1 2 3 4 5 6 7 8 9 11 12 13 15 16 ...
3
votes
1answer
111 views

Naive line-by-line comparison like “comm -3” but looking like “diff -y”

I am looking from something which gives me an output of comm -3 on two sorted outputs (line-by-line comparison, only additional/missing lines from either side) but which looks more like the output ...
1
vote
2answers
1k views

Can linux command comm handle UTF-8 encoded text files?

I want to compare two UTF-8 encoded text file. Can Linux command diff and comm handle these encoding?
1
vote
1answer
196 views

Compare two files line by line without comm (I need to maintain order of file 1)

File 1: happy sad calm palm File 2: palm dream calm I want to compare the two files and display only those line that are common in both the files, but I want to maintain the order of File 2. My ...
0
votes
2answers
213 views

How to compare multiple files and display the common lines?

I have four files like so: File 1 contents (tab separated, 3 columns): applepen apple pen strawberry straw berry File 2 contents: applepen strawjelly File 3 contents(This file is sorted): apple ...
2
votes
2answers
406 views

compare 1 column in 2 files and print the different line

I have file1 and file2. file1: a james b mike d john file2: a 10 20 30 40 b 11 12 13 14 c 20 30 40 50 d 10 20 30 50 I want the output file to only find the difference in column 1, and print that ...
4
votes
2answers
649 views

Find IP addresses visiting /page1 but not /page2 from nginx access logfile

I need to select specific data's from log files. I need two scripts: I need to select all IP addresses that only visited /page1 I need to select all IP addresses that visited /page1 but never visited ...
-1
votes
2answers
501 views

collect and create tab separated matrix

I have 6 text files (each corresponds to a specific sample) and each file looks like this: Gene_ID Gene_Name Strand Start End Length Coverage FPKM TPM ENSMUSG00000102735 Gm7369 + ...
0
votes
1answer
56 views

Compare a certain lines from multiple documents

I want to compare a certain lines in a multiple documents. I tried using diff and comm, but the conditions are these, the documents are in a different working directory/folder, I could use a wildcard ...
4
votes
2answers
76 views

Invert matching lines, NUL-separated

I’m writing something that deals with file matches, and I need an inversion operation. I have a list of files (e.g. from find . -type f -print0 | sort -z >lst), and a list of matches (e.g. from ...
0
votes
3answers
1k views

Matching lines in two files [duplicate]

Let's say I have two files, file1 and file2. file1: passd:xxx hopla:alli gnar:gungg araf:utap file2: alli utap How can i check what lines/words from file2 match file? Indeed I could probably do ...
2
votes
1answer
171 views

Is comm output guaranteed sorted?

Is the output of comm guaranteed sorted? In my simple examples they are and that makes sense to me (how I think comm works); however, I need to comm very large files and worried that comm might do ...
4
votes
2answers
1k views

Comparing files in unix columnwise

I want to compare two files with same number of rows and columns with records in same order. Just want to highlight the differences in the column values if any. file A: 1,kolkata,19,ab 2,delhi,89,...
4
votes
2answers
4k views

RFCOMM device seems to be missing (dev/rfcomm0)

I am trying to send and receive serial commands over bluetooth. I have installed pyBluez library. The issue is that while the rfcomm.conf exists there is no rfcomm0 in /dev/ directory. I rebooted but ...
0
votes
1answer
2k views

comm not working to find unique words to file1 from two files

I have two text files in which I have to use the comm command to extract all unique words from file 1. So just those that are not in file 2. I was asked to use the comm command (not diff nor join). I ...
3
votes
2answers
2k views

comm fails on bash variable input

I have a script that's supposed to get the list of files of two directories, get differences and execute some code for certain files. These are the commands to get the file lists: list_in=$(find ...
9
votes
1answer
7k views

comm: file is not in sorted order

I used comm to compare two sorted files. Each line in these files are positive integer numbers. But the results show comm: file 1 is not in sorted order comm: file 2 is not in sorted order How come ...
3
votes
3answers
9k views

Find common elements in a given column from two files and output the column values from each file

I have two files with tab-separated values that look like this: file1: A 1 B 3 C 1 D 4 file2: E 1 B 3 C 2 A 9 I would like to find rows between files 1 and 2 where the ...
4
votes
3answers
19k views

Issues of using sort and comm

I was trying to find the intersection of two plain data files, and found from a previous post that it can be done through comm -12 <(sort test1.list) < (sort test2.list) It seems to me that ...
1
vote
1answer
1k views

Diff similar lines

I'd like to print a list of lines where the first word in two files is identical, and the rest of the words are not. Some complicated mess with comm, grep and cut would be possible, but hopefully ...