How can I remove the first part of a string in Bash?

bash, shell

Solution

You should have a look at `info cut`, which will explain what `f1` means.

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-

Problem

This code will give the first part, but how can I remove it and get the whole string without the first part? ``` echo "first second third etc"|cut -d " " -f1 ```

Original source

Related problems