Skip to content

Instantly share code, notes, and snippets.

@glw
Created February 17, 2022 00:12
Show Gist options
  • Save glw/3e2bb72c416e4e1e6991b53be1c7f52c to your computer and use it in GitHub Desktop.
Save glw/3e2bb72c416e4e1e6991b53be1c7f52c to your computer and use it in GitHub Desktop.
recursively find duplicate files names in a directory
find /path/to/directory/ -type f -print0 | awk -F/ 'BEGIN { RS="\0" } { n=$NF } k[n]==1 { print p[n]; } k[n] { print $0 } { p[n]=$0; k[n]++ }' > duplicate_files.txt
source: https://unix.stackexchange.com/a/468461/363004
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment