DETOX(1)
π DETOX(1) β the glow-up your filenames have been waiting for π
okay bestie, so this is a General Commands Manual page, and today we're talking about detox. she cleans up filenames. that's it, that's the whole vibe, and honestly? she ate. β¨
β¨ NAME β¨
detox β clean up filenames π§Ό
πΈ SYNOPSIS πΈ
detox [-f configfile] [-n | --dry-run] [-r] [-s sequence] [--special]
[-v] file ...
detox [-L] [-f configfile] [-v]
detox [-h | --help]
detox [-V]
π¦ DESCRIPTION π¦
so detox is this utility that renames files so they're, like, actually pleasant to work with on Linux and other Unix-like operating systems. it takes the characters that make a filename a nightmare to type out and swaps them for dashes and underscores. slay. π
it also gives you transcoding-based filters, converting ISO-8859-1 or CP-1252 to UTF-8. and there's a bonus filter that unescapes CGI-escaped filenames, because of course there is. π
π Sequences π
detox is driven by a configurable series of filters, and we call that a sequence. sequences get the full deep-dive treatment in detoxrc(5), and you can also just peek at what's available with the -L option. the default sequence runs the safe and wipeup filters. other pre-configured sequence examples include iso8859_1 and iso8859_1-legacy, and both of those transcode to UTF-8, then finish up with the safe and wipeup filters. iconic behavior, honestly. π
π Options π
-f configfileβ use configfile instead of the default configuration files for loading translation sequences. and no, no other config file will be parsed. it's configfile or nothing, periodt.-h,--helpβ shows you helpful information. bestie help, basically. π«Ά--inlineβ runs in inline mode. checkinline-detox(1)for the full tea. π-Lβ lists the currently available sequences. and when you pair it with-v, it shows what filters each sequence uses plus any properties applied to those filters. the full receipts, no cap.-n,--dry-runβ doesn't actually change anything. heads up: this implies the-voption. it's giving "let me think about it" energy and we respect that. π-rβ recurse into subdirectories. any file or directory that starts with a period, like.git/or.cache/, gets ignored during recursion unless you specify it on the command line. also, anything listed in theignoresection of the config file gets ignored during recursion too. read the room, hidden files. π-s sequenceβ use sequence instead of default.--specialβ works on special files (including links). normallydetoxignores those files entirely. but ngl,detoxwill not recurse into symlinks that point at directories. know the limits, queen.-vβ be verbose about which files are being renamed. loud and proud. π£-Vβ shows the current version ofdetox.
π FILES π
/etc/detoxrcβ the system-wide detoxrc file.~/.detoxrcβ a user's personal detoxrc. normally it extends the system-wide detoxrc, unless-fhas been specified, in which case it's ignored. sorry babe, rules are rules./usr/share/detox/cp1252.tblβ the provided CP-1252 transcoding table./usr/share/detox/iso8859_1.tblβ the provided ISO-8859-1 transcoding table./usr/share/detox/safe.tblβ the provided safe character translation table./usr/share/detox/unicode.tblβ the provided Unicode control character filtering table, used by the UTF-8 filter.
β EXAMPLES β
detox -s lower -r -v -n /tmp/new_files
will run the sequence lower recursively, listing any changes, without changing anything, on the files of /tmp/new_files. a lil preview, a lil look, no commitment. π
detox -f my_detoxrc -L -v
will list the sequences within my_detoxrc, showing their filters and options. show me everything, bestie. π₯
π SEE ALSO π
inline-detox(1), detox.tbl(5), detoxrc(5), ascii(7), iso_8859-1(7), unicode(7), utf-8(7)
π« HISTORY π«
detox was originally designed to clean up files that I had received from friends which had been created using other operating systems. it's trivial to create a filename with spaces, parenthesis, brackets, and ampersands under some operating systems. those have special meaning within FreeBSD and Linux, and they cause problems when you go to access them. so I created detox to clean up these files. a classic origin story, fr fr. πΈ
Version 2.0 stepped back from transliteration out of the box, and instead focused on ease of use. Version 3.0 shifted things even further by removing most of the transliteration from the tables. the primary motivations for this were user-provided feedback, and the fact that many modern Unix-like OSs use UTF-8 as their primary character set. transliterating from UTF-8 to ASCII in that scenario is lossy and pointless. and we don't do pointless here. π
π«Ά AUTHORS π«Ά
detox was written by Doug Harple. legend behavior.
π CAVEATS π
if, after the translation of a filename is finished, a file already exists with that same name, detox will not rename the file. so likeβ¦ she's polite. she's not gonna overwrite your stuff. no chaos, no drama, just vibes. β¨
and that's the whole page, bestie!! this one came from Debian, dated March 31, 2024. go forth and let detox fix your filenames, you absolute icon. ππ¦π
π¦ where this page comes from
- arch rolling: detox 3.0.1-1 Β· BSD-3-Clause
- fedora 43: detox 3.0.1-1.fc43 Β· LicenseRef-Callaway-BSD
- fedora 44: detox 3.0.1-3.fc44 Β· LicenseRef-Callaway-BSD
- nixos 26.05: detox 3.0.1
- nixpkgs unstable: detox 3.0.1
- ubuntu stonking: detox 3.0.1-1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms