• Mac OS X,  Mac OS X Server,  Mac Security,  Ubuntu,  Unix,  VMware

    Show Line Numbers When Viewing A File

    The nl command is used to show line numbers when viewing a file (unless you use the -b option along with an n, which seems to be one of the more pointless things to ever do at the command line, but then what do I know…). So if you’d like to see the line numbers for a file called xsbackup.sh: nl xsbackup.sh The output would look like this: 1 # 2 #!/bin/bash 3 # 4 # Script Name: Or at least, that’s how I used to do it. For decades I never noticed that cat had a -b option. So if you’d like to use cat to see line numbers…