In Linux, I have the following problem with paste from (GNU coreutils) 8.13:

Trying to set another delimiter than the default (TAB) results in either just printing the first character of the defined delimiter or perfectly ignoring it.

Question: How does one define (multiple) delimiters when using paste?

Simply using, e.g. abc-123 as delimiter would be nice. With "multiple" I mean e.g. 2 TABS instead of one.

The patterns enclosing the delimiter(s) I've tried so far were

  • --delimiters="\delimiter"
  • --delimiters='\delimiter'
  • --delimiters=$"\delimiter"
  • --delimiters=$'\delimiter'

All with the same result: Only the first character is accepted or perfectly ignored. I've also tried the short version -d"\" and multiple instances &ndahs; nothing.


  • --delimiters="\\" → Error message

What works perfectly, though not what I want:

  • --delimiters="\n" → newline
  • --delimiters="\0" → nothing inbetween
  • --delimiters="\t"TAB, the default. Great.

To have abc inbetween file1 and file2, you can do:

paste -d abc file1 /dev/null /dev/null file2


paste -d abc file1 - - file2 < /dev/null

If you want two tabs:

paste file1 /dev/null file2
  • "using /dev/null to create two columns in text processing" works (besides: is this common knowledge I've missed so far and if not: where did you get this information from?) – erch Feb 18 '14 at 19:38
  • 1
    @Chirp.NotLuke. /dev/null acts like an empty file when reading, so you're pasting file1, and empty file, and empty file, file2 with separators being, in turn, a, b and c. Details on how -d works are in the paste man page. – Stéphane Chazelas Feb 18 '14 at 20:40
  • @StéphaneChazelas can you also add pr -mts'abc' file1 file2 as alternative? – Sundeep Jan 4 '17 at 6:28

It's because you are giving it only two files to join, each character of delimiter string is used between each join of lines from each of the input files.


file1 line1 DELIMCHAR0 file2 line1 DELIMECHAR1 file3 line1 ...
file1 line2 DELIMCHAR0 file2 line2 DELIMECHAR1 file3 line2 ...

On BSD systems (not Linux to my knowledge), there is the lam (as in “laminate”) utility, which is faster and shorter than the above solution:

lam file1 -s delimiter file2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.