How to remove the first part of a string in bash?

前端 未结 5 811
一向
一向 2021-02-07 05:48

This code will give the first part, but how to remove it, and get the whole string without the first part?

echo \"first second third etc\"|cut -d \" \" -f1
         


        
5条回答
  •  一整个雨季
    2021-02-07 05:54

    You should have a look at info cut, which will explain what f1 means. Also, a same question here: question-7814205

    Actually we just need fields after(and) the second field. -f tells the command to search by field, and 2- means the second and following fields.

    echo "first second third etc" | cut -d " " -f2-
    

提交回复
热议问题