What does `-b t` do?

QuestionsQuestions8 SkillsProDec, 22 2025
0100

Great question!

The -b t option tells nl to number only non-empty lines (lines that contain text).

Actually, -b t is the default behavior of the nl command. If you run nl config.txt without any flags, it behaves exactly as if you had typed nl -b t config.txt.

Here is a breakdown:

  • -b: Stands for body numbering style.
  • t: Stands for "non-empty text lines".

Comparison:

  • nl -b a: Numbers all lines (including blanks).
  • nl -b t: Numbers only lines that have text (skips blanks).

If you run nl -b t config.txt in your terminal right now, you will notice that the blank lines (like line 4) will lose their numbers again, making the output look cleaner if those empty lines aren't important to your reference.

Do you want to try running it to see the difference?

0 Comments

no data
Be the first to share your comment!