FATSORT(1)

πŸ’… FATSORT(1) β€” the fatsort manual, but make it cute

okay bestie so this is the manual page for fatsort, section 1 of the manual (that's the "user commands" girlies πŸ’–). it sorts the directory structure of your FAT file system and honestly? it's giving organizational queen. let's get into it πŸŽ€

✨ NAME ✨

fatsort β€” FAT file system sorting utility πŸ”₯

πŸ¦‹ SYNOPSIS πŸ¦‹

fatsort [OPTIONS] DEVICE

like. that's it. that's the whole vibe. options in, device in, sorted directories out πŸ’…

🌸 DESCRIPTION 🌸

FATSort sorts the directory structure of FAT file systems β€” and she does not discriminate, we're talking FAT12, FAT16, FAT32, and exFAT. all of them. inclusivity icon πŸ‘‘


πŸŽ€ Sort options πŸŽ€

these are the ones that decide how things get sorted, iykyk:

  • -a β€” use ASCII order for sorting. old school, no thoughts, just bytes.
  • -c β€” ignore the case of file names (this is the default for most locales, so she's basically always serving this anyway).
  • -I PFX β€” ignore the prefix PFX when comparing file names. like, pretend it's not even there πŸ’€
  • -n β€” use natural order sorting. numbers sorted like a human would, not like a robot would. periodt.
  • -o FLAG β€” set the sort order of files, where FLAG is one of these three:
    • d β€” directories first (this is the default, so if you didn't say anything, this is what you got 🫢)
    • f β€” files first
    • a β€” do not distinguish between files and directories (chaos. egalitarian. kinda iconic.)
  • -r β€” sort in reverse order. flip the whole thing.
  • -R β€” sort in random order. no cap.
this option overrides all the other sort options. it's the main character and everyone else is in the background πŸ’…
  • -t β€” sort by last modification date and time. chronological queen πŸ•°οΈ

πŸ’œ Directory-picking options πŸ’œ

the following options can be specified multiple times to control which directories get sorted:

  • -d DIR β€” sort the specified directory DIR only. just her. nobody else.
  • -D DIR β€” sort DIR and all its subdirectories. the whole family, we love a plus-one situation.
  • -x DIR β€” exclude DIR from sorting. not her, leave her alone please πŸ™ˆ
  • -X DIR β€” exclude DIR and all its subdirectories from sorting. the whole branch gets uninvited. sorry babes ✨

🧚 Regex directory-picking 🧚

the following options can also be specified multiple times, and they select directories using POSIX.2 extended regular expressions:

  • -e RE β€” only sort directories matching regular expression RE. if she matches, she gets sorted πŸ’–
  • -E RE β€” don't sort directories matching regular expression RE. if she matches, she's off the list 😭
Note: options -e and -E cannot be used together with -d, -D, -x and -X. it's one or the other, bestie, don't try to have both. it's giving conflict.
  • -L LOC β€” use the specified locale LOC instead of the system locale. FATSort follows locale-specific rules when sorting file names and directories, so if you want it to sort the way your locale says, you pick the locale. slay 🌈

⭐ More options ⭐

the leftovers that are still lowkey essential:

  • -l β€” list the current file order only. she shows, she doesn't touch. admiring from afar.
  • -i β€” display file system information only. all the tea, no changes.
  • -f β€” force sorting even if the file system is mounted. bold. brave. maybe reckless. but she'll do it.
  • -h, --help β€” display this help message 🫢
  • -v, --version β€” show version information.
  • -q β€” suppress all non-error output. shhh. silent mode. only problems get to speak πŸ”‡

DEVICE must be a FAT12, FAT16, FAT32 or exFAT file system. no NTFS girlies allowed, sorry πŸ™ˆ

⚠️ WARNING: THE FILE SYSTEM MUST BE CONSISTENT (I.E., FREE OF ERRORS) BEFORE RUNNING FATSORT. THERE IS A RISK OF FILE SYSTEM CORRUPTION. ALWAYS BACK UP YOUR DATA. ⚠️ okay genuinely, bestie, this is the part where you do NOT skip the reading. run your checks first. back your data up first. this is the realest warning on this whole page and I am not being dramatic, fr fr πŸ’€

πŸ“ ENVIRONMENT πŸ“

the environment variable LC_ALL determines the system locale used by FATSort. so if you wanna change how she sorts, that's one of your levers 🎚️

✨ EXAMPLES ✨

okay, the part everyone actually scrolls to:

fatsort /dev/sda

sort /dev/sda. that's it. that's the example. one device, one sort, chef's kiss πŸ‘‘

fatsort -n /dev/sdb1

sort /dev/sdb1 using natural order. now the numbers make sense to your eyeballs. obsessed πŸ¦‹

πŸ’– AUTHOR πŸ’–

written by Boris Leidner. thank you for your service 🫢

πŸ› REPORTING BUGS πŸ›

report bugs to <fatsort@formenos.de>. tell her everything, she can handle it πŸ’Œ

copyright Β© 2004-2026 Boris Leidner. License GPLv2: GNU GPL version 2 (see LICENSE.txt).

this is free software: you are free to change and redistribute it. there is NO WARRANTY, to the extent permitted by law. so like, she's free and she's yours but she's also not promising you anything 🫢


and that's the whole page babe!! this was the fatsort manual from version 1.7.1, dated March 2026. go forth and sort responsibly, and remember: back up your data before you do anything spicy πŸ’…βœ¨πŸŽ€

periodt. πŸ’–

πŸ“¦ where this page comes from