Safely rename files to their SHA1 sum + ext on FreeBSD 11
Safely rename files to their SHA1 sum + ext on FreeBSD 11
I have a collection of files with external origin which had bad names. The worst characters that they contained were some UTF-8 characters and the single quotation mark. Aside from these characters, there were other unwanted characters such as spaces in the file names. For this collection of files, because I use the metadata that is inside of the files to organize them, I don't care so much what the files are called, as long as they don't contain non-ASCII, non-printable or other troublesome characters. I wrote a script for FreeBSD 11 to safely rename such files to be named by their own SHA1 hash sum plus their original extension. (Files with bad characters in extension are made extension-less.) Here is the script: https://github.com/eriknstr/utils/blob/master/shaname.sh I have commented the script in detail so that readers may quickly see what's going on and which assumptions are made, so that they may determine whether the script is appropriate for their use-case. I reiterate that the script was written for FreeBSD 11 and should not be used on platforms with commands that have incompatible arguments. The script is released under the ISC license. Pull requests are welcome.
Share cardActual performance
Launch Intel predictions
Analyze your own launch →Correct prediction on native model
Similar products
Rename anything
C++11 immutable string
Lthread C++11 bindings for lthread lib
Tutoring for 11+, GCSE & A-Levels
DiscoPy – Rename Music Files with the Discogs API
Rename local files in bluk with AI without uplaod file or filename
Rename and organise files in seconds with RenameTool.
edmv – Bulk rename files with your favourite editor
AiRenamify - Smartly Rename Your Files with AI
Game #11: The Three Hearts