{
    "mode": "man",
    "parameter": "join-dctrl",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/join-dctrl/1/json",
    "generated": "2026-10-22T10:00:40Z",
    "synopsis": "join-dctrl [ options ] filename filename",
    "sections": {
        "NAME": {
            "content": "join-dctrl - perform relational join on data in dctrl format\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "join-dctrl [ options ] filename filename\n",
            "subsections": [
                {
                    "name": "join-dctrl --version",
                    "content": ""
                },
                {
                    "name": "join-dctrl --help",
                    "content": ""
                }
            ]
        },
        "DESCRIPTION": {
            "content": "join-dctrl  performs  a  relational join operation on data given to it in Debian control file\nformat.\n\nA join field must be specified using either the switches -1 and -2 or the switch -j.  Concep‐\ntually, the program creates all ordered pairs of records that  can  be  formed  by  having  a\nrecord  from the first file as the first member of the pair and having a record from the sec‐\nond file as the second member of the pair; and then it deletes all such pairs where the  join\nfields  are not equal.  Effectively, each of the input files is treated as a relational data‐\nbase table.\n\nEvery input file must be in ascending order on its join field; this  allows  the  program  to\nwork fast.  The sort-dctrl(1) program can be used to make it so.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-1 _ --1st-join-field=_",
                    "content": "Specify the join field of the first input file.\n",
                    "flag": "-1",
                    "long": "--1st-join-field",
                    "arg": "_"
                },
                {
                    "name": "-2 _ --2nd-join-field=_",
                    "content": "Specify the join field of the second input file.\n",
                    "flag": "-2",
                    "long": "--2nd-join-field",
                    "arg": "_"
                },
                {
                    "name": "-j _ --join-field=_",
                    "content": "Specify a common join field for all files.\n",
                    "flag": "-j",
                    "long": "--join-field",
                    "arg": "_"
                },
                {
                    "name": "-a _ --unpairable-from=_",
                    "content": "Specify  that  unmatched paragraphs from the first (if 1 is given) or the second (if 2\nis given) file are printed.\n",
                    "flag": "-a",
                    "long": "--unpairable-from",
                    "arg": "_"
                },
                {
                    "name": "-o _ --output-fields=_",
                    "content": "Specify which fields are included in the output.  Fields are separated by commas (more\nthan one -o option can  be  used,  too).   Each  field  is  specified  in  the  format\nfileno.field  in  which  fileno is the ordinal number of the input file from which the\nfield is drawn (either 1 or 2), and field gives the name of the field to  use.   As  a\nspecial  case,  simple  0  can  be used instead of fileno.field to refer to the common\nvalue of the join fields.\n\nThe name of the field (not including the file number) is used in  the  output  as  the\nname  of the field.  However, a different name for output purposes can be specified by\nsuffixing the field specification by a colon and the preferred visible name.\n\nFor example, the option -o 0,1.Version:Old-Version,2.Version specifies that the  first\nfield  in  any output record should be the join field, the second field should be Old-\nVersion drawing its data from the Version field of the first input file, and the third\nfield should be Version drawing its data from the field with the same name in the sec‐\nond input file, and these are the only fields in an output record.\n\nIf no -o option is given, all fields of all the records being joined are  included  in\nthe output.\n",
                    "flag": "-o",
                    "long": "--output-fields",
                    "arg": "_"
                },
                {
                    "name": "-l _ --errorlevel=_",
                    "content": "Set  log  level  to level.  level is one of fatal, important, informational and debug,\nbut the last may not be available, depending on the compile-time options.  These cate‐\ngories are given here in order; every message that is emitted when fatal is in effect,\nwill be emitted in the important error level, and so on. The default is important.\n",
                    "flag": "-l",
                    "long": "--errorlevel",
                    "arg": "_"
                },
                {
                    "name": "-V --version",
                    "content": "Print out version information.\n",
                    "flag": "-V",
                    "long": "--version"
                },
                {
                    "name": "-C --copying",
                    "content": "Print out the copyright license.  This produces much output; be sure  to  redirect  or\npipe it somewhere (such as your favourite pager).\n",
                    "flag": "-C",
                    "long": "--copying"
                },
                {
                    "name": "-h --help",
                    "content": "Print out a help summary.\n",
                    "flag": "-h",
                    "long": "--help"
                }
            ]
        },
        "OPERANDS": {
            "content": "join-dctrl  will treat each file named on the command line as a relational database table.  A\nfile called - represents the program's standard input stream.  Currently, exactly  two  files\nmust be named.\n",
            "subsections": []
        },
        "STDIN": {
            "content": "The standard input stream may be used as input as specified above in the OPERANDS section.\n",
            "subsections": []
        },
        "INPUT FILES": {
            "content": "All input to join-dctrl is in the format of a Debian control file.\n\nA  Debian control (dctrl) file is a semistructured single-table database stored in a machine-\nparseable text file.  Such a database consists of a set of records; each record is a  mapping\nfrom  field  names  to field content.  Textually, records are separated by empty lines, while\neach field is encoded as one or more nonempty lines inside a record.  A field starts with its\nname, followed by a colon, followed by the field content.  The colon must reside on the first\nline of the field, and the first line must start with no whitespace.   Subsequent  lines,  in\ncontrast, always start with linear whitespace (one or more space or tab characters).\n\nEach input file must be in the ascending order of its join field.\n",
            "subsections": []
        },
        "ENVIRONMENT VARIABLES": {
            "content": "The  standard  locale environment, specifically its character set setting, affects the inter‐\npretation of input and output as character streams.\n",
            "subsections": []
        },
        "ASYNCHRONOUS EVENTS": {
            "content": "Standard UNIX signals have their usual meaning.\n",
            "subsections": []
        },
        "STDOUT": {
            "content": "All output is sent to the standard output stream.  The output is in the format  of  a  Debian\ncontrol  file, described above in the INPUT FILES section.  The output will be in the ascend‐\ning order of the join field, if that field is included in the output.\n",
            "subsections": []
        },
        "OUTPUT FILES": {
            "content": "There are no output files.\n",
            "subsections": []
        },
        "EXIT STATUS": {
            "content": "This utility exits with 0 when successful.  It uses a nonzero exit code  inconsistently  when\nan error is noticed (this is a bug).\n",
            "subsections": []
        },
        "CONSEQUENCES OF ERRORS": {
            "content": "In  case of errors in the input, the output will be partially or completely garbage.  In case\nof errors in invocation, the program will refuse to function.\n",
            "subsections": []
        },
        "EXAMPLES": {
            "content": "Suppose that a file containing data about binary packages for  the  AMD64  architecture  con‐\ntained  in  the  Debian  squeeze (6.0) release, section main, is in the current directory and\nnamed Packages.  Suppose that we are currently on a Debian system.  Suppose further that  the\ncurrent  directory  does not contain files named stat and pkg.  The following commands gives,\nfor each package currently installed and available in Debian squeeze (6.0), its currently in‐\nstalled version (as Old-Version) and the version in squeeze (as New-Version):\n$ sort-dctrl -kPackage /var/lib/dpkg/status > stat\n$ sort-dctrl -kPackage Packages > pkg\n$ join-dctrl -j Package \\\n-o 0,1.Version:Old-Version,2.Version:New-Version \\\nstat pkg\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "The join-dctrl program and this manual page were written by Antti-Juhani Kaijanaho.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "grep-dctrl(1), sort-dctrl(1), tbl-dctrl(1)\n\n\njoin-dctrl(1)",
            "subsections": []
        }
    },
    "summary": "join-dctrl - perform relational join on data in dctrl format",
    "flags": [
        {
            "flag": "-1",
            "long": "--1st-join-field",
            "arg": "_",
            "description": "Specify the join field of the first input file."
        },
        {
            "flag": "-2",
            "long": "--2nd-join-field",
            "arg": "_",
            "description": "Specify the join field of the second input file."
        },
        {
            "flag": "-j",
            "long": "--join-field",
            "arg": "_",
            "description": "Specify a common join field for all files."
        },
        {
            "flag": "-a",
            "long": "--unpairable-from",
            "arg": "_",
            "description": "Specify that unmatched paragraphs from the first (if 1 is given) or the second (if 2 is given) file are printed."
        },
        {
            "flag": "-o",
            "long": "--output-fields",
            "arg": "_",
            "description": "Specify which fields are included in the output. Fields are separated by commas (more than one -o option can be used, too). Each field is specified in the format fileno.field in which fileno is the ordinal number of the input file from which the field is drawn (either 1 or 2), and field gives the name of the field to use. As a special case, simple 0 can be used instead of fileno.field to refer to the common value of the join fields. The name of the field (not including the file number) is used in the output as the name of the field. However, a different name for output purposes can be specified by suffixing the field specification by a colon and the preferred visible name. For example, the option -o 0,1.Version:Old-Version,2.Version specifies that the first field in any output record should be the join field, the second field should be Old- Version drawing its data from the Version field of the first input file, and the third field should be Version drawing its data from the field with the same name in the sec‐ ond input file, and these are the only fields in an output record. If no -o option is given, all fields of all the records being joined are included in the output."
        },
        {
            "flag": "-l",
            "long": "--errorlevel",
            "arg": "_",
            "description": "Set log level to level. level is one of fatal, important, informational and debug, but the last may not be available, depending on the compile-time options. These cate‐ gories are given here in order; every message that is emitted when fatal is in effect, will be emitted in the important error level, and so on. The default is important."
        },
        {
            "flag": "-V",
            "long": "--version",
            "arg": null,
            "description": "Print out version information."
        },
        {
            "flag": "-C",
            "long": "--copying",
            "arg": null,
            "description": "Print out the copyright license. This produces much output; be sure to redirect or pipe it somewhere (such as your favourite pager)."
        },
        {
            "flag": "-h",
            "long": "--help",
            "arg": null,
            "description": "Print out a help summary."
        }
    ],
    "examples": [
        "Suppose that a file containing data about binary packages for  the  AMD64  architecture  con‐",
        "tained  in  the  Debian  squeeze (6.0) release, section main, is in the current directory and",
        "named Packages.  Suppose that we are currently on a Debian system.  Suppose further that  the",
        "current  directory  does not contain files named stat and pkg.  The following commands gives,",
        "for each package currently installed and available in Debian squeeze (6.0), its currently in‐",
        "stalled version (as Old-Version) and the version in squeeze (as New-Version):",
        "$ sort-dctrl -kPackage /var/lib/dpkg/status > stat",
        "$ sort-dctrl -kPackage Packages > pkg",
        "$ join-dctrl -j Package \\",
        "-o 0,1.Version:Old-Version,2.Version:New-Version \\",
        "stat pkg"
    ],
    "see_also": [
        {
            "name": "grep-dctrl",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/grep-dctrl/1/json"
        },
        {
            "name": "sort-dctrl",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/sort-dctrl/1/json"
        },
        {
            "name": "tbl-dctrl",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/tbl-dctrl/1/json"
        }
    ],
    "tldr": {
        "source": "not_found",
        "examples": []
    }
}