> For the complete documentation index, see [llms.txt](https://book.bsdcn.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://book.bsdcn.org/man/man5/motd.5.md).

# motd.5

`motd` — 包含每日消息的文件

## 名称

`motd`

## 描述

文件 **/var/run/motd** 通常在用户登录之后、运行 shell 之前由 [login(1)](/man/man1/login.1.md) 显示。该文件一般用于发布重要的全系统公告。系统启动时，会在 **/etc/motd.template** 前面添加一行包含内核版本字符串的内容，并将结果写入 **/var/run/motd**。

更新 **/etc/motd.template** 后，无需重启系统即可通过手动重启 motd 服务来更新 **/var/run/motd**：

```sh
service motd restart
```

用户可以在自己的主目录中创建一个名为 “`.hushlogin`” 的文件，或者通过 login.conf(5) 来禁止显示该文件。

## 文件

**/etc/motd** 指向 **/var/run/motd** 的符号链接。

**/etc/motd.template** 系统管理员可编辑的模板文件。

**/var/run/motd** 每日消息。

**$HOME/.hushlogin** 禁止输出 **/var/run/motd**。

## 实例

```sh
FreeBSD 12.1-RELEASE (GENERIC) #0: Sun Dec 29 03:08:31 PST 2019
/home is full.  Please cleanup your directories.
```

## 参见

[login(1)](/man/man1/login.1.md), login.conf(5)

## 历史

在 FreeBSD 13.0 之前，`motd` 位于 **/etc** 目录下。


---

# 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, and the optional `goal` query parameter:

```
GET https://book.bsdcn.org/man/man5/motd.5.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
