Linux, plaintext & minimalism
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.

Tags: detox | CLI | Utilities


I don't have a commenting system simply because I haven't found a solution that I like. If you want to leave any feedback and/or have any questions feel free to contact me either via e-mail, the fediverse, by XMPP or by IRC (I'm Hund at freenode.net).