Sa

Safely rename files to their SHA1 sum + ext on FreeBSD 11

Hacker News

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 card

Actual performance

1points
1comments
Did not reach leaderboard

Launch Intel predictions

Analyze your own launch →
Indie HackersFits the IH revenue-focused audience · Strong signals: compatible · Missing: supports, reddit linkedin, podcasting
56%56% predicted probability of success on Indie Hackers, based on ML models trained on real launch data.
best fitHighest predicted score across all platforms for this description.
AppSumoMay struggle as an AppSumo deal · Strong signals: plus, platform · Missing: intuitive, reviews, host
43%43% predicted probability of success on AppSumo, based on ML models trained on real launch data.
Product HuntUnlikely to reach the leaderboard · Strong signals: single · Missing: mac, agents, macos
42%42% predicted probability of success on Product Hunt, based on ML models trained on real launch data.
Hacker NewsMay not resonate with HN audience · Strong signals: ide, io · Missing: https docs, excited, just released
40%40% predicted probability of success on Hacker News, based on ML models trained on real launch data.
nativeThis product was originally launched on this platform.
TrustMRRLess likely to generate early MRR · Missing: mobile apps, ios, personal
40%40% predicted probability of success on TrustMRR, based on ML models trained on real launch data.
Acquire.comPre-revenue stage for this audience · Missing: arr, mrr, revenue
16%16% predicted probability of success on Acquire.com, based on ML models trained on real launch data.
BetaListMay not resonate with beta-testers · Missing: web3, chat, crypto
2%2% predicted probability of success on BetaList, based on ML models trained on real launch data.

Correct prediction on native model

Similar products

Re
Rename anything46%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Rename anything

Hacker News1
C+
C++11 immutable string56%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

C++11 immutable string

Hacker News23
Lt
Lthread C++11 bindings for lthread lib27%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Lthread C++11 bindings for lthread lib

Hacker News2
R.A.N. Tutors
R.A.N. Tutors24%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Tutoring for 11+, GCSE & A-Levels

Indie Hackers
Di
DiscoPy – Rename Music Files with the Discogs API49%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

DiscoPy – Rename Music Files with the Discogs API

Hacker News2
Re
Rename local files in bluk with AI without uplaod file or filename34%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Rename local files in bluk with AI without uplaod file or filename

Hacker News7
File Rename Tool
File Rename Tool73%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Rename and organise files in seconds with RenameTool.

Indie Hackers1productivity
ed
edmv – Bulk rename files with your favourite editor43%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

edmv – Bulk rename files with your favourite editor

Hacker News1
AiRenamify
AiRenamify64%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

AiRenamify - Smartly Rename Your Files with AI

Product Hunt
Ga
Game #11: The Three Hearts37%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Game #11: The Three Hearts

Hacker News1