Switch to SpeakEasy.net DSL

The Modular Manual Browser

Home Page
Manual: (SunOS-4.1.3)
Apropos / Subsearch:
optional field

PASTE(1V)                                                            PASTE(1V)

       paste  - join corresponding lines of several files, or subsequent lines
       of one file

       paste filename1 filename2 ...
       paste -dlist filename1 filename2 ...
       paste -s [ -dlist ] filename

       This command is available  with  the  System  V  software  installation
       option.  Refer to for information on how to install optional software.

       In  the  first two forms, paste concatenates corresponding lines of the
       given input files filename1, filename2, etc.  It treats each file as  a
       column  or  columns  of  a  table and pastes them together horizontally
       (parallel merging).  It is the counterpart of  cat(1V)  which  concate-
       nates  vertically, that is, one file after the other.  In the last form
       above, paste replaces the function of an older command  with  the  same
       name  by combining subsequent lines of the input file (serial merging).
       In all cases, lines are glued together with the TAB character, or  with
       characters  from  an optionally specified list.  paste can be used as a
       filter, if - is used in place of a filename.

       -d     Without this option, the NEWLINE characters of each but the last
              file  (or  last line in case of the -s option) are replaced by a
              TAB character.  This option allows replacing the  TAB  character
              by  one  or more alternate characters in list.  The list is used
              circularly; when exhausted, it is reused.  In  parallel  merging
              (no  -s  option), the lines from the last file are always termi-
              nated with a NEWLINE character, not from  the  list.   list  may
              contain the special escape sequences: \n (NEWLINE), \t (tab), \\
              (backslash), and \0 (empty string, not a null character).  Quot-
              ing  may be necessary, if characters have special meaning to the

       -s     Merge subsequent lines rather than one  from  each  input  file.
              Use  TAB  for  concatenation,  unless list is specified with -d.
              Regardless of the list, the very last character of the  file  is
              forced to be a NEWLINE.

       List directory in four columns:

              ls | paste----

       Combine pairs of lines into lines:

              paste -s -d"\t\n" filename

       cat(1V), cut(1V), grep(1V), pr(1V)

       line too long
              Output lines are restricted to 511 characters.

       too many files
              Except  for -s option, no more than 12 input files may be speci-

                               17 September 1989                     PASTE(1V)