The Cookie Machine - Click here to drag window

DUMMY TEXT - Real text set in assets/js/theCookieMachine.js

If you can read me, I'm broken!

Views: 2,378     Votes:  2 
Tags: command-line   files   text-processing  
Link: 🔍 See Original Answer on Ask Ubuntu ⧉ 🔗

Title: Find an identical file with a different name
ID: /2018/02/28/Find-an-identical-file-with-a-different-name
Created: February 28, 2018    Edited:  June 12, 2020
Upload: September 20, 2023    Layout:  post
TOC: false    Navigation:  false    Copy to clipboard:  false

Grep can find it quickly

When used properly, the grep command can find the duplicate quickly. You must be careful not to search the whole file system or it will take days to complete. I recently documented this here: greping all files for a string takes a long time

For optimum speed use:

grep -rnw --exclude-dir={boot,dev,lib,media,mnt,proc,root,run,sys,/tmp,tmpfs,var} '/' -e 'String in file'

If your file might be on a Windows directory remove the mnt directory.

If you know the file is within the /home directory someplace you can shorten the command:

grep -rnw '/home' -e 'String in file'
⇧ How can I copy /home and / to new partitions on the same drive which I can boot into for testing. Ubuntu 17.10 - Poweroff operation is inhibited by myself  ⇩