Usage 1: To add lines to standard output
$ nl -ba /etc/hosts.allow 1 # 2 # hosts.allow This file describes the names of the hosts which are 3 # allowed to use the local INET services, as decided 4 # by the '/usr/sbin/tcpd' server. 5 # 6where -ba => prepend numbers to all lines
Usage 2: To add lines to non-blank text
$ nl -bt /etc/hosts.allow 1 # 2 # hosts.allow This file describes the names of the hosts which are 3 # allowed to use the local INET services, as decided 4 # by the '/usr/sbin/tcpd' server. 5 #where -bt => prepend lines to non-blank lines
Usage 3: Format the numbering to Left Justify
$ nl - bt -nln /etc/hosts.allow 1 # 2 # hosts.allow This file describes the names of the hosts which are 3 # allowed to use the local INET services, as decided 4 # by the '/usr/sbin/tcpd' server. 5 #where -bt => prepend lines to non-blank lines
-nln => format the number to be left-justify
Usage 4: Format the numbering to Right Justify
$ nl -bt -nrn /etc/hosts.allow 1 # 2 # hosts.allow This file describes the names of the hosts which are 3 # allowed to use the local INET services, as decided 4 # by the '/usr/sbin/tcpd' server. 5 #