RSS Subscription
Linux Howtos & Tutorials

Enter your email:

Delivered by


NOTE:New tutorials are from LinuxCareer.com

Poll

Do you own or wish to have iPhone?
 


Linux eBooks FREE Download
A guide to programming Linux kernel modules
Introduction to Linux - A Hands on Guide
A Newbie's Getting Started Guide to Linux

Linux from Scratch - Create Your Own Linux System - Free eBook

Linux: The Hacking Solution (v.3.0)

SQLite 3 with PHP Essential Training – Free Video Training Tutorials

This guide will introduce you to the world of GNU/Linux

The GNU/Linux Advanced Administration

A Complete Beginner's Manual for Ubuntu 10.04 (Lucid Lynx)

Advanced Bash-Scripting Guide

Set up, maintain, and secure a small office email server

Partner Linux Sites:
How-To.LinuxCareer.com
Jobs.LinuxCareer.com
TuxMachines
Monsterb
LinuxBloggers
AdamsInfo
LinuxScrew
All For Linux

join

Article Index
1. Name
2. Synopsis
3. Frequently used options
4. Examples

1. Name

join [man page] - join lines of two files on a common field

2. Synopsis

join [OPTION]... FILE1 FILE2 

3. Frequently used options

-j FIELD
equivalent to `-1 FIELD -2 FIELD'
-1 FIELD
join on this FIELD of file 1
-2 FIELD
join on this FIELD of file 2

4. Examples

Join command can be as a simple database join table.

Suppose that we have two following files, file1:

echo -e "0001 =\n0010 =\n0011 =\n0100 =\n0101\
 =\n0111 =" | nl > file1

join - create a sample file 1

$ echo -e "one\ntwo\nthree\nfour\nfive\nsix" | nl > file2 

join - create a sample file 2
now we can use join command to join those two files:

$ join -j 1 file1 file2 

join files with join command

Share this linux post:

Submit join in Delicious Submit join in Digg Submit join in FaceBook Submit join in Google Bookmarks Submit join in Stumbleupon Submit join in Technorati Submit join in Twitter
 
Comments for this page are closed !!!
Please visit our new Linux Forum for additional help or discussion.


Linux eBooks FREE Download