天天看點

shell--所有行前加序号

方法一:

awk '{printf("%d,%s\n",NR,$0)}' filename

方法二:

cat -n filename

方法三:

nl filename