How can I add numbers to the beginning of every line in a file?
E.g.:
This is the text from the file.
Becomes:
000000001 This is
000
You're looking for the nl(1) command:
$ nl -nrz -w9 /etc/passwd
000000001 root:x:0:0:root:/root:/bin/bash
000000002 daemon:x:1:1:daemon:/usr/sbin:/bin/sh
000000003 bin:x:2:2:bin:/bin:/bin/sh
...
-w9 asks for numbers nine digits long; -nrz asks for the numbers to be formatted right-justified with zero padding.