dup is a program for easy duplication of files.
Give it a filename as an argument and it will create a new file with a unique name and identical contents.
$ ls a.txt $ dup a.txt; ls a.txt 'a(1).txt' $ dup a.txt; ls a.txt 'a(1).txt' 'a(2).txt'
go install git.sr.ht/~ajpaon/dup@latest
Álvaro Ramírez's blog post "Duplicate this". He implements this functionality as an emacs function. I chose to reimplement as a standalone executable to make it usable outside of emacs.