我试图通过不将文件打印到另一个文件来删除文件的前两行。我不是在寻找一些奇特的东西。这是我对 awk 的(失败的)尝试:
awk '{ (NR > 2) {print} }' myfile
这会抛出以下错误:
awk: { NR > 2 {print} }
awk: ^ syntax error
Example:
“我的文件”的内容:
blah
blahsdfsj
1
2
3
4
我想要的结果是:
1
2
3
4
使用尾部:
tail -n+3 file
从手册页:
-n, --lines=K
output the last K lines, instead of the last 10; or use -n +K
to output lines starting with the Kth
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)