The nl command numbers the lines in its input files.
In its simplest invocation, nl concatenates the contents of the file names given as arguments to standard output, with sequential line numbers. A file name of '-' (a single hyphen) as with most Unix commands, means to read from standard input.
A simple example:
$ cat > sample first line second line ^D $ nl sample 1 first line 2 second line $
These all relate to the output or processing of entire files