October 10, 2018

Cleaning up filenames with detox

Detox is a neat little command-line tool that helps you clean up filenames. It will either remove or replace weird character, like Á will be replaced with A, an empty space with _ and it’s even smart enough to replace CGI escaped ASCII characters like %20 with _.

Here’s a small example:

$ cd Pictues/Wallpapers/Space
$ detox --dry-run *
atlantis_nebula__7_by_starkiteckt-1080p.jpg -> atlantis_nebula_7_by_starkiteckt-1080p.jpg
cold_embrace___high_resolution___by_starkiteckt-db385qy.png -> cold_embrace_high_resolution_by_starkiteckt-db385qy.png
Hyper Cradle 1920x1080 HD.png -> Hyper_Cradle_1920x1080_HD.png

The defaults should be good enough for most, but there’s a lot of configuration options available and you can read all about them via the manual pages.

Comments

I'm looking into a good way of implementing comments on my blog that works without JavaScript, respects the users privacy and is reasonably user friendly. If you have any ideas or just want to give me some feedback on this blog post or if you just want to say hello, feel free to do so either via e-mail, XMPP or Mastodon.