FSTAB-DECODE(8)
โจ NAME โจ
okay bestie, this is fstab-decode from the Linux System Administrator's Manual ๐ It's a section 8 page, and the whole thing is about running a command with fstab-encoded arguments ๐ง
fstab-decode - run a command with fstab-encoded arguments
๐ SYNOPSIS ๐
fstab-decode COMMAND [ARGUMENT ...]
๐ DESCRIPTION ๐
okay so fstab-decode decodes escapes (like newline characters and other whitespace) in the ARGUMENTs you give it, then uses them to run COMMAND ๐ซถ The escaping uses the exact same rules as path escaping in /etc/fstab, /etc/mtab and /proc/mtab, so it's all one big happy family ๐ธ
In essence, you can use fstab-decode any time you want to pass a bunch of parameters to a command as a list of command line arguments. It takes output that looks like this:
/root
/mnt/remote-disk
/home
and turns it into one long list of parameters, "/root /mnt/remote-disk /home" โจ Super useful when you're dealing with multiple filesystems at once. For example, you can use it to unmount a whole pile of NFS shares in one go ๐ฆ
This program also strips out whitespace and other sneaky characters that could make programs like mount(8) or umount(8) fail. Major clean-up energy ๐งผโจ
๐ EXIT STATUS ๐
fstab-decode exits with status 127 if COMMAND can't be run ๐ Otherwise, it exits with whatever status COMMAND returned. So it's basically just passing the baton ๐โโ๏ธ๐จ
๐ EXAMPLES ๐
ok this one is iconic ๐ญ The example reads fstab, finds every VFAT filesystem, and prints their mount points (that's argument 2 in the fstab file). Then fstab-decode runs the program you specify, umount(8), and hands it the list of VFAT mountpoints. Result: every VFAT partition gets unmounted ๐ฅ
fstab-decode umount $(awk '$3 == "vfat" { print $2 }' /etc/fstab)
๐ฆ SEE ALSO ๐ฆ
fstab(5) ๐
bestie that's the whole page ๐ It's from sysvinit, dated May 2006, so it's a little vintage but the vibes are still immaculate ๐ โจ
๐ฆ where this page comes from
- debian trixie: sysvinit-utils 3.14-4 ยท GPL-2.0-or-later
- opensuse-leap 16.0: sysvinit-tools-doc 3.14-160000.2.2 ยท GPL-2.0-or-later
- ubuntu questing: sysvinit-utils 3.14-4ubuntu1 ยท GPL-2.0-or-later
- ubuntu resolute: sysvinit-utils 3.15-5ubuntu1 ยท GPL-2.0-or-later
- ubuntu stonking: sysvinit-utils 3.18-1ubuntu1 ยท GPL-2.0-or-later
- Copyright (C) 2006 Red Hat, Inc. All rights reserved
- ๐ girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms