2
0
mirror of https://github.com/chubin/cheat.sheets synced 2024-11-11 01:10:31 +00:00
cheat.sheets/sheets/nl
terminalforlife a7e9bd13e1 Add 'nl' file and show basic example
Interestingly -- to me, at least, `nl` by default will only number
non-empty lines (coreutils v8.25), whereas `cat` will show all.
2019-11-06 16:34:45 +00:00

8 lines
263 B
Plaintext

# Number lines given to `nl` via STDIN.
printf "Here\nis\nsome\nexample\ntext." | nl
# Number (all) lines given to `nl` via provided file(s).
nl -b a /path/to/file
# The above can also be achieved with `cat`, which is perhaps more portable:
cat -n /path/to/file