Remove First Word in text stream

雨燕双飞 提交于 2019-11-30 02:58:31

based on your example text,

cut -d' ' -f2- yourFile

should do the job.

That should work:

$ cat test.txt
some text 1
some text 2
some text 3

$ sed -e 's/^\w*\ *//' test.txt
text 1
text 2
text 3

Here is a solution using awk

awk '{$1= ""; print $0}' yourfile 

run this sed "s/^some\s//g" myfile you even don't need to use a pipe

To remove the first word, until space no matter how many spaces exist, use: sed 's/[^ ]* *//'

Example:

$ cat myfile 
some text 1
some  text 2
some     text 3

$ cat myfile | sed 's/[^ ]* *//'
text 1
text 2
text 3
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!