Try comm
Another way to look at it:
-
Show lines that only exist in file a: (i.e. what was deleted from a)
comm -23 a b
-
Show lines that only exist in file b: (i.e. what was added to b)
comm -13 a b
-
Show lines that only exist in one file or the other: (but not both)
comm -3 a b | sed 's/^\t//'
(Warning: If file a
has lines that start with TAB, it (the first TAB) will be removed from the output.)
Sorted files only
NOTE: Both files need to be sorted for comm
to work properly. If they aren’t already sorted, you should sort them:
sort <a >a.sorted
sort <b >b.sorted
comm -12 a.sorted b.sorted
If the files are extremely long, this may be quite a burden as it requires an extra copy and therefore twice as much disk space.
Related Posts:
- Git error on git pull (unable to update local ref)
- How can I diff 2 files while ignoring leading white space
- omparing the contents of two files in Sublime Text
- Run Oracle SQL script and exit from sqlplus.exe via command prompt
- Show full process name in top
- How to zip/unzip files in Powershell?
- Logitech/LGHUB Lua – Loop with break
- What exactly is a VBO in OpenGL?
- No results found on kibana -> discover
- Official definition of CSCI (Computer Software Configuration Item)
- What does %>% mean in R [duplicate]
- How do I copy folder with files to another folder in Unix/Linux? [closed]
- How do I fix a “Expected Primary-expression before ‘)’ token” error?
- What is archive mode in rsync?
- Turn off pager for psql’s interactive output
- What does “xmlns” in XML mean?
- How do I get my C# program to sleep for 50 msec?
- What is an idiomatic way of representing enums in Go?
- Why the range of int is -32768 to 32767?
- syntaxerror: “unexpected character after line continuation character in python” math
- Flash Player Projector post 2020
- How to update multiple columns in single update statement in DB2
- what does the __file__ variable mean/do?
- Error in .External.graphics R
- How do I call git diff on the same file between 2 different local branches?
- Assembly’s manifest definition does not match assembly reference
- “unrecognized selector sent to instance” error in Objective-C
- Java – No enclosing instance of type Foo is accessible
- Center Plot title in ggplot2
- what is the difference between OLE DB and ODBC data sources?
- How to use PHP’s password_hash to hash and verify passwords
- How to make and apply SVN patch?
- How to create a custom coder?
- Git push won’t do anything (everything up-to-date)
- How to use vmImage on pipeline using Azure DevOps Server?
- git add . -> still “nothing to commit” with new files
- git submodule add error: does not have a commit checked out
- “The certificate chain was issued by an authority that is not trusted” when connecting DB in VM Role from Azure website
- What’s the complete range for Chinese characters in Unicode?
- Is there an operation for not less than or not greater than in python?
- Resource interpreted as stylesheet but transferred with MIME type text/html (seems not related with web server)
- Background color for Tk in Python
- how to uninstall MinGW and make cygwin ‘make’ as deafult make program with gcc 3.8.1
- Cosine similarity and tf-idf
- Optional Parameters in Go?
- PostgreSQL: Remotely connecting to Postgres instance using psql command
- Android – Package Name convention
- How to execute an oracle stored procedure?
- How do I time a method’s execution in Java?
- -bash: export: `=’: not a valid identifier
- Error “The goal you specified requires a project to execute but there is no POM in this directory” after executing maven command
- Error in glm() in R
- What is a good Hash Function?
- Excel Filters – show only relevant values in the filter
- Unable to convert 3d ply file image to 2d image
- Get a random item from a JavaScript array
- Plotting horizontal and vertical lines in Mathematica
- Error while waiting for device: Time out after 300seconds waiting for emulator to come online
- How to transparent Unity3D custom shader?
- Converting string to integer VB.NET
- Remove node_modules from git in vscode
- How do you change session timeout in IIS 8.5?
- Is it valid to have a html form inside another html form?
- what is shortcut command to kill process in windows command?
- How can I see the changes in a Git commit?
- Differentiate between function overloading and function overriding
- How to print variable in sml?
- Why is the minidlna database not being refreshed?
- java.sql.SQLException: Fail to convert to internal representation
- Command prompt won’t change directory to another drive
- Representing EOF in C code?
- How to disable an Android button?
- How to set initial value and auto increment in MySQL?
- Chrome Broweser: csi.gstatic.com keeps loading
- How do you convert an entire directory with ffmpeg?
- What’s the difference between sx and σx in the statistics calculations on a TI-Nspire?
- Apache Kafka vs Apache Storm
- How can an Admin access the Google Drive contents of all the users in a particular domain?
- PSEXEC, access denied errors
- How do you define a global function in C++?
- A _disk_id.pod file appears on a windows flash drive
- What standard do language codes of the form “zh-Hans” belong to?
- What is the proof of of (N–1) + (N–2) + (N–3) + … + 1= N*(N–1)/2
- Merge posts plugin? [closed]
- database collation differences
- Add Woocommerce product to cart with Contact Form 7 [closed]
- How to See Everything in get_option()?
- How can I prevent the WordPress Importer from munging double-newline paragraph breaks to a single newline?
- Slow WP Site, theme.php not caching? Up to 25 second load time! [closed]
- A Compare And Distinction Essay Define To Beat Writer’s Block
- 27 Outstanding Faculty Essay Examples
- The Way To Write An Essay Outline In Four Steps
- How to hide subfolder of static pages in WordPress using htaccess
- Javascript: Add anchor hashtag to URL, and reload
- To remove rendering of menus and header, plugin or theme?
- Redirect, Change URLs or Redirect HTTP to HTTPS in Apache – Everything You Ever Wanted to Know About mod_rewrite Rules but Were Afraid to Ask
- List all DNS records in a domain using dig?
- How to cd into a directory with this name “-2” (starting with the hyphen)?
- How to add dependency on a Windows Service AFTER the service is installed
- Monday morning mistake: sudo rm -rf –no-preserve-root /