Поиск дубликатов

Apr 06, 2024 08:14

find ./ -type f -exec md5 {} \; | awk -F '=' '{print $2 "\t" $1}' | sort | tee duplicates.txt

https://osx86project.org/blog/how-to-find-duplicate-files-on-mac/

Как вариант - обработать файл постгресом

https://postgresapp.com/downloads.html

загрузить файл в базу

CREATE unlogged  TABLE tmp (md TEXT, path TEXT);
cd /Applications/Postgres.app/Contents/Versions/latest/bin
cat /путь/duplicates.txt | ./psql -d starwoofy -c "COPY tmp FROM STDIN"

select md, path from  tmp
where md in
(
select md from tmp
group by md
having count(*)>1
)
order by md,path;

Сохранить результат в файл

Остановить (удалить) постгрес

zsh, postgresapp, terminal, postgresql, duplicate, macos

Previous post Next post
Up