Skip to content

Instantly share code, notes, and snippets.

@oh2fih
oh2fih / lndupes.py
Created July 24, 2024 07:20 — forked from jeroenvermeulen/lndupes.py
Reads fdupes(-r1) output and create relative symbolic links for each duplicate
#!/usr/bin/env python3
# source: https://gist.github.com/filipenf/e9901883d66b8da65c151cf674e5f2a9
# source: https://gist.github.com/jeroenvermeulen/a1667c60dc159c8f0487acee2cca256f
#
# Reads fdupes(-r -1) output and create relative symbolic links for each duplicate
# usage: fdupes -r1 . | ./lndupes.py
import os
from os.path import dirname, relpath, basename, join
import sys