Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想知道一种读取文件并删除所有以数字开头的文本行的好方法,即使用一些shell脚本[0-9]。提前致谢!
你可以使用这样的东西:
grep -v '^[0-9]' input-file > output-file
Using sed:
sed '/^[0-9]/d' file > outfile
If you have GNU sed, the original file itself can be updated:
sed -i '/^[0-9]/d' file