Unix/Linux中/usr目录的由来

在Linux系统中,有一个很重要的目录——/usr目录。关于这个目录名称的由来,网上主要有下面几种说法:

user的缩写
User Shareable Read-only的缩写
Unix/User System Resources的缩写
Unix/User Software Resources的缩写

目前大多数版本的Linux中/usr目录主要放置的是可执行文件和先关库文件,因此user好像不太可能。
查阅了相关的资料,关于/usr目录起源的说法如下:

/usr usually contains by far the largest share of data on a system.
Hence, this is one of the most important directories in the system as
it contains all the user binaries, their documentation, libraries,
header files, etc…. X and its supporting libraries can be found
here. User programs like telnet, ftp, etc…. are also placed here. In
the original Unix implementations, /usr was where the home directories
of the users were placed (that is to say, /usr/someone was then the
directory now known as /home/someone). In current Unices, /usr is
where user-land programs and data (as opposed to ‘system land’
programs and data) are. **The name hasn’t changed, but it’s meaning has
narrowed and lengthened from “everything user related” to “user usable
programs and data”.** As such, some people may now refer to this
directory as meaning ‘User System Resources’ and not ‘user’ as was
originally intended.
/usr is shareable, read-only data. That means that /usr should be
shareable between various FHS-compliant hosts and must not be written
to. Any information that is host-specific or varies with time is
stored elsewhere.
Large software packages must not use a direct subdirectory under the
/usr hierarchy.

/usr目录存放了系统中重要的二进制文件,文档,库文件,头文件等等。在早起的Unix版本中,/usr目录是作为用户的家目录而存在的(相当于现在的/home目录),因此这个目录的名字最开始应该是user的缩写,表示用户的家目录。而现在的Unix版本中,/usr目录的作用已经大不相同了,主要存放的是一些非系统启动必要的程序和数据。因此一些人把/usr目录的含义引申为User System Resources.

/usr目录存放共享的,只读的数据。这意味着/usr应该是可以在兼容FHS标准的主机间共享的,并且其中的数据是不应该被修改的。那些与主机属性相关或者经常变动的数据不应该存放在次目录。

大型的软件包不要使用/usr下的子目录存放。

由此以来,/usr目录的由来就真相大白了。你可以称之为User System Resources或者User Shareable Read-only. Whatever, 了解它的历史和作用就好。

转载https://segmentfault.com/a/1190000000497217

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值