# 11.4.直接打印

对于偶尔的打印，可以直接将文件发送到打印机设备，而无需任何设置。例如，可以将名为 `sample.txt` 的文件发送到 `USB` 打印机：

```sh
# cp sample.txt /dev/unlpt0
```

直接打印到网络打印机取决于打印机的功能，但大多数打印机都接受通过 9100 端口的打印任务，且可以使用 [nc(1)](https://man.freebsd.org/cgi/man.cgi?query=nc\&sektion=1\&format=html) 与它们配合使用。要将相同的文件打印到 `DNS` 主机名为 *netlaser* 的打印机：

```sh
# nc netlaser 9100 < sample.txt
```


---

# Agent Instructions: 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://book.bsdcn.org/hanbook/di-11-zhang-da-yin/11.4.-zhi-jie-da-yin.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.
