fbpx
Wikipedia

join (Unix)

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

Overview

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. Both files have been sorted on the join field — this is a requirement of the program.

george jim kumar gunaware 
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.

History

join is intended to be a relation database operator. It is part of the X/Open Portability Guide since issue 2 of 1987. It was inherited into the first version of POSIX.1 and the Single Unix Specification.[1][2]

The version of join bundled in GNU coreutils was written by Mike Haertel.[3] The command is available as a separate package for Microsoft Windows as part of the UnxUtils collection of native Win32 ports of common GNU Unix-like utilities.[4]

See also

References

  1. ^ printf – Shell and Utilities Reference, The Single UNIX Specification, Version 4 from The Open Group
  2. ^ printf(1) – FreeBSD General Commands Manual
  3. ^ join(1) – Linux General Commands Manual
  4. ^ "Native Win32 ports of some GNU utilities". unxutils.sourceforge.net.

External links

  • join(1) – Plan 9 Programmer's Manual, Volume 1
  • join(1) – Linux User Commands Manual
  • join command

join, unix, join, command, unix, unix, like, operating, systems, that, merges, lines, sorted, text, files, based, presence, common, field, similar, join, operator, used, relational, databases, operating, text, files, joinoriginal, author, douglas, mcilroydevel. join is a command in Unix and Unix like operating systems that merges the lines of two sorted text files based on the presence of a common field It is similar to the join operator used in relational databases but operating on text files joinOriginal author s Douglas McIlroyDeveloper s AT amp T Bell LaboratoriesInitial releaseJanuary 1979 44 years ago 1979 01 Written inCOperating systemUnix Unix like Plan 9PlatformCross platformTypeCommandLicensecoreutils GPLv3 Plan 9 MIT License Contents 1 Overview 2 History 3 See also 4 References 5 External linksOverview EditThe 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 Both files have been sorted on the join field this is a requirement of the program george jim kumar gunaware 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 History Editjoin is intended to be a relation database operator It is part of the X Open Portability Guide since issue 2 of 1987 It was inherited into the first version of POSIX 1 and the Single Unix Specification 1 2 The version of join bundled in GNU coreutils was written by Mike Haertel 3 The command is available as a separate package for Microsoft Windows as part of the UnxUtils collection of native Win32 ports of common GNU Unix like utilities 4 See also EditTextutils Join SQL Relational algebra List of Unix commandsReferences Edit printf Shell and Utilities Reference The Single UNIX Specification Version 4 from The Open Group printf 1 FreeBSD General Commands Manual join 1 Linux General Commands Manual Native Win32 ports of some GNU utilities unxutils sourceforge net External links Edit The Wikibook Guide to Unix has a page on the topic of Commands join 1 Plan 9 Programmer s Manual Volume 1 join 1 Linux User Commands Manual join command This Unix related article is a stub You can help Wikipedia by expanding it vte Retrieved from https en wikipedia org w index php title Join Unix amp oldid 1096090989, wikipedia, wiki, book, books, library,

article

, read, download, free, free download, mp3, video, mp4, 3gp, jpg, jpeg, gif, png, picture, music, song, movie, book, game, games.