View a file with line numbers

cat -n /path/to/file | less

February 13, 2012openiduser28

Explanation

cat -n will number all lines of a file.

Limitations

It will add some white spaces as padding.

Related one-liners

View a file with line numbers

grep -n ^ /path/to/file | less

November 9, 2011bashoneliners