perl -pe'$_=$..$".$_' file #### perl -e 'print `cat -n $ARGV[0]`' file