Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I don't get the difference between the program lam

lam -- laminate files
The lam utility copies the named files side by side onto the standard output. The n-th input lines from the input files are considered fragments of the single long n-th output line into which they are assembled. The name `-' means the standard input, and may be repeated.

and paste

paste -- merge corresponding or subsequent lines of files
The paste utility concatenates the corresponding lines of the given input files, replacing all but the last file's newline characters with a single tab character, and writes the resulting lines to standard output. If end-of-file is reached on an input file while other input files still contain data, the file is treated as if it were an endless source of empty lines.

Except for the command options. I don't get the difference. Suppose I have two files a and b



I get

$ paste -d ',' a b

$ lam a -s',' b

They seem redundant in scope, although lam seems to be more flexible. The descriptions do not allow me to catch cases where they could behave differently. Does anybody have a clue ?

share|improve this question
They are redundant in scope. lam was part of BSD, paste AT&T. paste was later standardized in POSIX.2. lam hangs around for hysterical reasons. TIMTOWTDI – Richard Hoskins Jul 29 '09 at 17:18
@RichardHoskins In my opinion that's good enough to be an answer. Thanks! – isomorphismes Aug 13 '14 at 22:22

paste applies to complete files. Therefore it will concatenate complete files into a single file. Lines will be merge if they are the same.

lam applies to lines in a file as well as files. Therefore you can selectively concatenate lines into a new file.

share|improve this answer
Interesting, I have mostly used join for these things. – nik Jul 29 '09 at 15:27
@nik. So do I - Or I just do a copy – BinaryMisfit Jul 29 '09 at 15:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .