一些常用命令、小技巧备忘

移除文本中的备注和空行

获取文本文件source_file的内容、移除其中的备注和空行,并将剩余内容保存到new_file中

cat source_file |grep -v “^#” |grep -v “^$” > new_file

Leave a Reply

Your email address will not be published. Required fields are marked *