Shell trick #1: Numbering lines in text files
Hi, today I'll present you something new. It is an experiment and I'd be curios whether you like it. I've started a little series of ttyrecs. That means, I've recorded a little tip or trick on the console and uploaded it to PLAYterm so it can be easily played back in the browser. I thought it could be useful to do a little command line gymnastics.
Today I'll show you three ways how you can number lines in text files. We'll do that with cat, nl and vim.
Note: you need JavaScript enabled in order to play the ttyrec.