Comment by theshowmustgo
4 years ago
Nice but how do you prevent overwrites? What about directories/folders and the files in that directory/folder?
I have:
Movie Bla (2020)
Movie Bla (2020).mp4
But also:
Movie_Bla_(2020)
Movie_Bla_(2020).mp4
Movie_Bla_(2020).srt
Would not like to lose files like the the srt.
Yeah, sometimes I end up renaming things I don't want to, but it really doesn't happen all that often. And sometimes I throw caution to the wind, add some excitement to my life, and rename a bunch of files (not for anything professional) in some really old directory and hope I don't break anything. But I'm not aiming for perfect with this comment. I just mentioned in another comment, but the vast majority of times I run this is in my ~/Downloads folder on files I don't really worry about breaking.
rename will stop and output and error.