使用sed。比如:
1. 删除文件第三行。
sed -i '3d' file.txt
2. 删除文件中包含"NewBalance"的那行。
sed -i '/NewBalance/d' file.txt