That's a great question, and you've already observed it in action!
The default delimiter used by the paste command is a tab character.
When you ran:
paste fruits.txt colors.txt tastes.txt
The output you saw was:
apple red sweet
banana yellow sweet
cherry red sweet
Notice the spaces between "apple" and "red", and "red" and "sweet"? These are actually tab characters, which paste inserts by default to separate the columns (the content from each file).
You then explicitly changed this with the -d ':' option to use a colon as the delimiter, which clearly showed the change:
paste -d ':' fruits.txt colors.txt tastes.txt
apple:red:sweet
banana:yellow:sweet
cherry:red:sweet
So, to summarize:
- Default delimiter: Tab character
- To specify a different delimiter: Use the
-doption followed by the desired delimiter (e.g.,-d ','for a comma,-d ' 'for a space, or even-d '::'for a double colon).
Great job noticing this detail! This understanding helps a lot when you need to format output for specific purposes, like creating CSV (Comma Separated Values) files.
Do you have any other questions about paste or other commands?