cut

Linux · Text · available in the simulator

What it does

Remove sections from each line of files (fields or characters).

Syntax

cut [-d delim] [-f campos] [-c caracteres] [archivo...]

Options and parameters

  • -d C

    Use delimiter character instead of TAB.

  • -f N

    Select only these fields.

  • -c N-M

    Select only these characters.

  • -d

    Use specified delimiter instead of TAB for field delimiter.

    cut -d: -f1 /etc/passwd
  • -f

    Select only these fields.

  • -c

    Select only these characters.

    cut -c1-10 archivo.txt
  • -b

    Select only these bytes.

  • --complement

    Complement the set of selected bytes, characters or fields.

Usage examples

  • cut -d: -f1 /etc/passwd
  • cut -c1-10 archivo.txt
  • cut -c1-10 archivo
Practise cut

Related commands