Forrest logo
back to the nl tool

nl:tldr:a5471

nl: Number only the lines with printable text.
$ nl -t ${filename}
try on your machine

The command "nl -t ${filename}" is used to display a file with each line numbered. Here is a breakdown of the command:

  • "nl" is the command itself, which is used to number lines in a file. It treats standard input or specified files as input and adds line numbers before each line.
  • "-t" is an option used with the "nl" command. It specifies the format of the line numbering.
  • "${filename}" is a placeholder for the name of the file you want to display with line numbers. You would replace "${filename}" with the actual filename.

So, when you execute the command "nl -t ${filename}", it will print the contents of the specified file with line numbers, using the specified format for the line numbering.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the nl tool