用sed删除Linux中文本文件任意行的前五个字符 [英] Delete the first five characters on any line of a text file in Linux with sed
本文介绍了用sed删除Linux中文本文件任意行的前五个字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要一个单行来删除文本文件任何一行的前五个字符.我怎样才能用 sed 做到这一点?
I need a one-liner to remove the first five characters on any line of a text file. How can I do that with sed?
推荐答案
sed 's/^.....//'
意思
用空替换(s",替换)行首然后5个字符(.").
使用 sed 或 cut 有更紧凑或更灵活的方式来编写它.
There are more compact or flexible ways to write this using sed or cut.
这篇关于用sed删除Linux中文本文件任意行的前五个字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文