> For the complete documentation index, see [llms.txt](https://hezhiqiang.gitbook.io/linux/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hezhiqiang.gitbook.io/linux/ming-ling/join.md).

# join

两个文件中指定栏位内容相同的行连接起来

## 补充说明

**join命令** 用来将两个文件中，制定栏位内容相同的行连接起来。找出两个文件中，指定栏位内容相同的行，并加以合并，再输出到标准输出设备。

### 语法

```
join(选项)(参数)
```

### 选项

```
-a<1或2>：除了显示原来的输出内容之外，还显示指令文件中没有相同栏位的行；
-e<字符串>：若[文件1]与[文件2]中找不到指定的栏位，则在输出中填入选项中的字符串；
-i或--ignore-case：比较栏位内容时，忽略大小写的差异；
-o<格式>：按照指定的格式来显示结果；
-t<字符>：使用栏位的分割字符；
-v<1或2>：更-a相同，但是只显示文件中没有相同栏位的行；
-1<栏位>：连接[文件1]指定的栏位；
-2<栏位>：连接[文件2]指定的栏位。
```

### 参数

* 文件1：要进行合并操作的第1个文件参数；
* 文件2：要进行合并操作的第2个文件参数。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://hezhiqiang.gitbook.io/linux/ming-ling/join.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
