美文网首页
tail/head/less/more/wc

tail/head/less/more/wc

作者: 少女萌的进击之路 | 来源:发表于2021-07-26 21:32 被阅读0次

tail

1.tail - n 100  xxx.log #查看静态文件尾部100行
2.tail  -f   100  xxx.log # 查看不断刷新的文件尾部100行
3.tail -n +100  xxx.log# 
4.tail -n  -100   xxx.log#同1

head

1.head -n 100 xxx.log#查看文件头部100行

less

more

wc

1.wc xxx.log或者less xxx.log|wc #统计文件的行数、单词数、字符数
2.wc  -l xxx.log或者less  xxx.log|wc -l #统计文件的行数
3.wc  -w xxx.log或者less  xxx.log|wc -w#统计文件的单词数
4.wc  -c xxx.log或者less  xxx.log|wc -c #统计文件的字符数

echo

echo  -n  "1234567" #-n  用于避免echo添加额外的换行符

相关文章

网友评论

      本文标题:tail/head/less/more/wc

      本文链接:https://www.haomeiwen.com/subject/usggmltx.html