Linux

  1. Home
  2. Computing & Technology
  3. Linux
7.1 Linux Advanced Text Processing Tools
Learn advanced Linux commands
 
 Related Resources
• Linux Newbie Administrator Guide
• 0. Linux Benefit
• 1. Before Installation
• 2. Linux Resources/Help
• 3. Basic Operations FAQ
• 4. Newbie Admin FAQ
• ~ 4.1 Lilo
• ~ 4.2 Drives
• ~ 4.3 X-Windows
• ~ 4.4 Configurations
• ~ 4.5 Networking
5. Shortcuts / Commands
• 6. Linux Applications
• 7. Learn Linux Commands
• A. How to Upgrade Kernel?
 

join file1 file2 > file3

Join lines of two files on a common field.  join parallels the database operation "join tables", but works on text tables.  The default is to join on the first field of the first table, and the default delimiter is white space. To adjust the defauls, I use options which I find using man join).

Example. if the content of file1 was:
1 Barbara
2 Peter
3 Stan
4 Marie
and file2 was:
2 Dog
4 Car
7 Cat
the resulting file3 would be:
2 Peter Dog
4 Marie Car

Next > Back to "Learn Linux Commands"

Can't find what you are looking for?
Search the

Stay up-to-date!
Subscribe to the Linux free newsletter.

Explore Linux

About.com Special Features

Build Your Own Website

Step-by-step advice on how to do everything from choosing a Web host to promoting your content. More >

Connect Your Home Computers

Easy ways to connect two computers for networking purposes. More >

Linux

  1. Home
  2. Computing & Technology
  3. Linux

©2009 About.com, a part of The New York Times Company.

All rights reserved.