I want to use space as a delimiter with the cut
command.
What syntax can I use for this?
\s* - delimiter.
A space-delimited list is a kind of list (not a kind of space). It is a list which is delimited by spaces. The items x, y, and z have spaces between them: these spaces are the delimiters in the list. Likewise the list "x,y,z" is a comma-delimited list (it is in comma-delimited format).
Delimited formats Any character may be used to separate the values, but the most common delimiters are the comma, tab, and colon. The vertical bar (also referred to as pipe) and space are also sometimes used.
The tab character is the default delimiter of cut, so by default, it considers a field to be anything delimited by a tab. Remember that the "space" between each word is actually a single tab character, so both lines of output are displaying ten characters: eight alphanumeric characters and two tab characters.
cut -d ' ' -f 2
Where 2 is the field number of the space-delimited field you want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With