繁体   English   中英

bash- 如果 txt 文件的第二个字低于 X,我如何删除它的整行?

[英]bash- How can I remove the whole line of a txt file if its 2nd word is lower than X?

我有一个txt文件,如:

apple 200

orange 100

banana 10

在输出中,我希望他的行数低于 20:

apple 200

orange 100

您可以使用 awk:

awk '$2>=20' file
apple 200
orange 100

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM