1.查看文件结尾的内容
tail -f test.txt
2.查看文件的后100行,可以使用tail命令,如:
tail -100 filename 或 tail -n 100 filename
3.查看文件前n行内容
head -n test.txt
4.需要删除文件 example.txt 中所有的字符串 hello,并将内容输出至new.txt
sed 's/hello//g' example.txt > new.txt
1.查看文件结尾的内容
tail -f test.txt
2.查看文件的后100行,可以使用tail命令,如:
tail -100 filename 或 tail -n 100 filename
3.查看文件前n行内容
head -n test.txt
4.需要删除文件 example.txt 中所有的字符串 hello,并将内容输出至new.txt
sed 's/hello//g' example.txt > new.txt
本文标题:文件操作常用shell
本文链接:https://www.haomeiwen.com/subject/lcjaedtx.html
网友评论