Identifier / Programs / Linux and Unix
nl
Number lines from a file or from stdin. tldr-pages
GTFOBins file-read 1 Sigma rule name it 1 documented command
How nl is abused
file-read
-bn-w1-sSeparator to use between number and line (instead of TAB) toyboxEach abuse is GTFOBins's category and the options and words it uses; the full write-up is on GTFOBins's page for nl.
1 documented command
file-read unprivileged, with sudo, as SUID
The read file content is corrupted by a leading space added to each line.
nl -bn -w1 -s '' /path/to/input-fileIdentifyThe command the identifier reads trips no Sigma process-creation rule. This command is, 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 nl. The identifier reads the line that runs nl.
What detects it
Everyday use
Number non-blank lines in a file
nl path/to/fileIdentifyRead from stdin
command | nl -IdentifyNumber all body lines including blank lines or do not number body lines
nl -b a path/to/fileIdentify-bWhich lines to number: a (all) t (non-empty, default) pREGEX (pattern) toyboxNone of the 3 examples the identifier reads matches GTFOBins abuse or trips a Sigma process-creation rule.
Options
Show every option of nl
-EUse extended regex syntax (when doing -b pREGEX)-b MODEWhich lines to number: a (all) t (non-empty, default) pREGEX (pattern)-lOnly count last of this many consecutive blank lines-n STYLENumber STYLE: ln (left justified) rn (right justified) rz (zero pad)-s SEPARATORSeparator to use between number and line (instead of TAB)-vStarting line number for each section (default 1)-w WIDTHWidth of line numbers (default 6)