Identifier / Programs / Linux and Unix
fmt
Reformat a text file by joining its paragraphs and limiting the line width to a number of characters (75 by default). tldr-pages
GTFOBins file-read 2 documented commands
How fmt is abused
file-read
-pNON_EXISTING_PREFIXEach abuse is GTFOBins's category and the options and words it uses; the full write-up is on GTFOBins's page for fmt.
2 documented commands
file-read unprivileged, with sudo, as SUID
fmt -pNON_EXISTING_PREFIX /path/to/input-fileIdentifyfile-read unprivileged, with sudo, as SUID
This corrupts the output by wrapping very long lines at the given width (999).
fmt -999 /path/to/input-fileIdentifyNone of the 2 commands the identifier reads trips a Sigma process-creation rule. These commands are, with GTFOBins’ notes, from GTFOBins, at commit acd524623f9c of 2026-05-27, under the GPL-3.0, with no warranty. Changed: Markdown is shown formatted. The source is in lolbas-gtfobins-commands.json.gz, and the full entry is on GTFOBins’s page for fmt. The identifier reads the line of each that runs fmt.
Everyday use
Reformat a file
fmt path/to/fileIdentifyReformat a file producing output lines of (at most) n characters
fmt --width n path/to/fileIdentifyReformat a file without joining lines shorter than the given width together
fmt --split-only path/to/fileIdentifyNone of the 3 examples the identifier reads matches GTFOBins abuse or trips a Sigma process-creation rule.
Options
Show every option of fmt
-w WIDTHMaximum characters per line (default 75)