nl

Number lines

low risk

interactive breakdown — edit the command and press Explain
$ 
What it does

Prints a file with line numbers (only for non-empty lines by default).

Common flags
FlagMeaning
-baNumber all lines
-wNumber width
Examples
nl -ba file.txtNumber every line · explain & risk-check →
Related
cat wc
Open the full explainer →More in Text Processing

Reference text is hand-written and may be incomplete — check man nl for your version. Test destructive commands on a non-production system first.