获取文件行数:
awk ‘END{print NR}’ access.log
awk ‘{print NR}’ access.log|tail -n1
sed -n ‘$=’ access.log
wc -l access.log
cat access.log |wc -l
删除一个文件的前十行
sed -i ‘1,10d’ aa.txt
获取文件第一行
head -1 urfile
sed ‘q’ urfile
awk ‘{print;exit}’ urfile
sed -n 1p file
更详细的sed命令: http://www.cnblogs.com/dong008259/archive/2011/12/07/2279897.html
原创文章,作者:kepupublish,如若转载,请注明出处:https://blog.ytso.com/98641.html