Join (Unix)

Join (Unix)

join is a command in Unix-like operating systems that merges the lines of two sorted text files based on the presence of a common field. It is a sort of implementation of the join operator used in relational databases but operating on text files.

The join command takes as input two text files and a number of options. If no command-line argument is given, this command looks for a pair of lines from the two files having the same first field (a sequence of characters that are different from space), and outputs a line composed of the first field followed by the rest of the two lines.

The program arguments specify which character to be used in place of space to separate the fields of the line, which field to use when looking for matching lines, and whether to output lines that do not match. The output can be stored to another file rather than printing using redirection.

As an example, the two following files list the known fathers and the mothers of some people. Note that both files have been sorted on the join field - this is a requirement of the program.

george jim mary john

albert martha george sophie

The join of these two files (with no argument) would produce:

george jim sophie

Indeed, only "george" is common as a first word of both files.

ee also

* Textutils
* Join (SQL)
* Relational algebra
* List of Unix programs

External links

* [http://www.die.net/doc/linux/man/man1/join.1.html man page]
* [http://www.albany.edu/~ig4895/join.htm join examples]


Wikimedia Foundation. 2010.

Игры ⚽ Нужен реферат?

Look at other dictionaries:

  • Join (Unix) — Pour les articles homonymes, voir Join. join est une commande POSIX qui permet de fusionner les lignes de deux fichiers ayant des champs communs. Il fonctionne comme les jointures des bases de données relationnelles mais pour des fichiers texte.… …   Wikipédia en Français

  • join (Unix) — У этого термина существуют и другие значения, см. Join. join команда UNIX подобных операционных систем, объединяющая строки двух упорядоченных текстовых файлов на основе наличия общего поля. По своему функционалу схоже с оператором JOIN,… …   Википедия

  • join (Unix) — Pour les articles homonymes, voir Join. join est une commande POSIX qui permet de fusionner les lignes de deux fichiers ayant des champs communs. Elle réalise des jointures, au sens de l algèbre relationnelle, directement sur des fichiers texte.… …   Wikipédia en Français

  • Join — may refer to: * Join (law), to include additional counts or additional defendants on an indictment * Join (mathematics), a least upper bound in lattice theory * Join (relational algebra), a type of binary operator * Join (SQL), a SQL and… …   Wikipedia

  • Join — может относится к: Join (SQL) операция языка SQL и реляционных баз данных join (Unix) команда операционной системы Unix Joins (библиотека) API параллельных вычислений, разработанный Microsoft Research Joins.com веб сайт южнокорейской газеты… …   Википедия

  • Join-calculus (programming language) — In computer science, the join calculus is a programming language based on the identically named join calculus process calculus. It is implemented as an interpreter written in Ocaml, and supports statically typed distributed programming,… …   Wikipedia

  • UNIX — UNIX, parfois écrit « Unix », avec des petites capitales, est un système d exploitation multitâche et multi utilisateur créé en 1969, conceptuellement ouvert et fondé sur une approche par laquelle il offre de nombreux petits outils… …   Wikipédia en Français

  • Unix — (marque déposée officiellement comme UNIX, parfois aussi écrit comme Unix avec les petites capitalisations) est le nom d un système d exploitation multitâche et multi utilisateur créé en 1969, conceptuellement ouvert et fondé sur une approche par …   Wikipédia en Français

  • Système Unix — UNIX UNIX (marque déposée officiellement comme UNIX, parfois aussi écrit comme Unix avec les petites capitalisations) est le nom d un système d exploitation multitâche et multi utilisateur créé en 1969, conceptuellement ouvert et fondé sur une… …   Wikipédia en Français

  • Systèmes UNIX — UNIX UNIX (marque déposée officiellement comme UNIX, parfois aussi écrit comme Unix avec les petites capitalisations) est le nom d un système d exploitation multitâche et multi utilisateur créé en 1969, conceptuellement ouvert et fondé sur une… …   Wikipédia en Français

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”