cut

remove sections from each line of files

Cut the string before the first space
copy
11
1
echo "This is a test" | cut -f1 -d' 'Cut the string before the first space

details |

Result:

This

Options:

  • cut -f, cut --fields
    -f, --fields=LIST select only these fields; also print any line that contains no delimiter character, unless
  • cut -d, cut --delimiter
    -d, --delimiter=DELIM use DELIM instead of TAB for field delimiter