“hier(7)”和“file-hierarchy(7)”手册页有什么区别?

Flu*_*lux 7 linux filesystems man

无论hier(7)file-hierarchy(7)手册页声称描述传统文件系统层次结构。但是,它们之间存在一些差异。例如,hier(7)描述/opt/var/crash,但file-hierarchy(7)不描述。这两种描述有什么区别。真正的 Linux 系统使用哪一种?

Jde*_*eBP 13

hier手册有一个悠久的历史日期在1979年回Unix的第七版Linux操作系统中的一个已经不是原来的Unix之一,但克隆。

在世纪之交,FreeBSD 人记录了现有的长期实践,即系统管理员为他们自己的系统调整内容,并且一个优秀的系统管理员更改手册页以匹配本地调整。

当然,Linux 操作系统在 doco 方面是出了名的糟糕。hier分发维护者很少将手册页完全调整到实际操作系统,如果它有调整的话。例如,Debian 根本不打补丁,只是hier原样提供来自 Michael Kerrisk 的 Linux Manpages Project的底层通用手册页

(The BSDs have a generally much stronger tradition of the people who are making changes to the operating system including changes to its doco in what they do. Their doco is better as a result. But it is itself still woefully outdated in some areas. For example: The FreeBSD manual for the ul command has been missing large parts of the tool since 2.9BSD.)

So Lennart Poettering wrote his own manual page for systemd, file-hierarchy, in 2014. As you can see, despite its claim it really is not "more minimal" than the hier page. For starters, it documents a whole load of additional things about user home directories.

Thus there are two different manual pages from two different sets of people, none of whom are the distribution maintainers themselves, who actually decide this stuff.

The simple truth is that real Linux-based operating systems adhere to neither. There are distribution variations from vanilla systemd that don't get patched into the file-hierarchy page by the distribution maintainers; and as mentioned the hier page often does not get locally patched either.

They do not adhere to the Linux Filesystem Hierarchy Standard moreover. Several operating systems purposefully deviate from it, and a few of them document this. A few Linux operating systems intentionally do not reference it at all, such as GoboLinux. As you can see from the further reading, Arch Linux used to reference it but has since dropped it.

(I have a strong suspicion, albeit that I have done no rigorous survey, that Arch Linux dropping the FHS is the tipping point, and that adherence to the FHS is the exception rather than the norm for Linux operating systems now.)

For many Linux operating systems there simply is not a single manual page for this. The actual operating system will be an admixture of hier, file-hierarchy, the Linux Filesystem Hierarchy Standard, and individual operating system norms with varying degrees of documentation.

Further reading


Ste*_*itt 10

hier(7)来自man-pages 项目,应该反映Filesystem Hierarchy Standard

file-hierarchy(7)来自systemd,和

描述了这些规范的一个更小、更现代化的子集,它更严格地定义了 systemd 对文件系统层次结构提出的建议和限制。

特别是,后者更详细地描述了每个文件系统的使用和约束:它是主机本地的还是可以共享的,它是持久的还是可以tmpfs支持的,程序应该如何找到它等。

真正的 Linux 系统每个都有自己的文件系统策略,通常紧密基于 FHS。例如,Debian 的政策基于 FHS 的 3.0 版,但有一些例外。使用 systemd 的发行版(现在包括大多数非嵌入式发行版)在实践中最终遵循 systemd 要求。