In this command :
cut -f2 -d$'\t'
('\t'
) what is it mean ?
i saw it another question, i got the idea about "tab" delimiter but still want to know '\t'
shortcut or sign or command for something
In this command :
cut -f2 -d$'\t'
('\t'
) what is it mean ?
i saw it another question, i got the idea about "tab" delimiter but still want to know '\t'
shortcut or sign or command for something
The horizontal tabulator character is a character that by default brings the cursor up to the next multiple of eight spaces when it's outputted.
Example:
$ printf '1234567*1234567*\na\thello\tthere\n'
1234567*1234567*
a hello there
As you can see above, for each tab character, the cursor is forwarded to the next multiple of eight spaces.
The tab character is written as \t
in the C programming language. Printing a string containing \t
with printf
in the shell or with printf()
in C (and in many other places) produces a horizontal tab character in place of the two characters \
and t
.
In the bash
shell, $'...'
is a special "C escape string". Within it, escape sequences like \t
(for tab) or \n
(for newline) are treated just like in printf()
in the C language. This is described in the bash
manual in the section titled "QUOTING".
With cut -d $'\t'
you tell cut
to use tab as the delimiter when cutting the fields of the input data. However, this happens to be the default delimiter that cut
will use if you don't use -d
at all, so -d $'\t'
is not needed in your command.