Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
gnosis
on Feb 26, 2012
|
parent
|
context
|
favorite
| on:
Useful use of cat(1)
The nl command (part of coreutils) is specifically written for numbering lines. It can do simple line numbering, along with various other styles and formats.
Its man page can be seen here:
http://linux.die.net/man/1/nl
veyron
on Feb 26, 2012
[–]
awk's sprintf can do all of that. Not saying it's the right tool for the job, but the parent did have a pipeline already using awk.
Consider applying for YC's Spring batch! Applications are open till Feb 11.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
Its man page can be seen here: http://linux.die.net/man/1/nl