--- layout: page topic: The nl command author: Domenico Votta category_title: Advanced Commands category_page: Advanced tags: number lines title: nl ---

The nl is a command that permits to number the lines. Through some flags you can decide how to filter this command.

We have a file named example.txt that contains 5 elements, to test this command: {% highlight ruby linenos %} Car Computer Robot Smartphone Videogame {% endhighlight %} The syntax command is:
 nl [flags][file] 
{% highlight ruby linenos %} nl example.txt 1 Car 2 Computer 3 Robot 4 Smartphone 5 Videogame {% endhighlight %}

How you can see the command has numbered the lines.

Flags

Here a list that contains the main flags of these command: