How to define 'tab' delimiter with 'cut' in BASH?

Two ways:

Press Ctrl+V and then Tab to use "verbatim" quoted insert.

cut -f2 -d'   ' infile

or write it like this to use ANSI-C quoting:

cut -f2 -d$'\t' infile

Tab is the default.

See the cut man page.

-d delim
         Use delim as the field delimiter character instead of the tab
         character.

So you should just write

cut -f 2

awk -F '\t' '{ print $2 }' inputfile

This extracts the second tab-delimited field of each line of input from inputfile.

Tags:

Bash

Cut