V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
justjavac
V2EX  ›  Linux

usr 真的是 Unix Shared Resources 的缩写,而不是 user 的缩写吗?

  •  2
     
  •   justjavac ·
    justjavac · 2015-11-16 15:19:20 +08:00 · 14223 次点击
    这是一个创建于 3056 天前的主题,其中的信息可能已经有所发展或是发生改变。

    刚才看《开源世界旅行手册》,原来 usr 是 Unix Shared Resources 的缩写,真是涨姿势了,我一直以为是 user 的缩写

    Unix Shared Resources

    97 条回复    2015-12-12 00:22:00 +08:00
    ufo22940268
        1
    ufo22940268  
       2015-11-16 15:34:24 +08:00
    yylzcom
        2
    yylzcom  
       2015-11-16 15:36:50 +08:00
    我真的以为是 user 的缩写

    Regular Expression 正则表达式这个理解不能,对普通人来说才不 regular 了吧
    banxi1988
        3
    banxi1988  
       2015-11-16 15:37:04 +08:00
    我以前也以为是 user 的简写,之前听有人说, unix 的目录为了节省尽量控制在三个字符。

    现在年到这些缩写很感慨 ,其中的很多的缩写,都感觉是全新的单词似的。
    lib,tmp,var,bin,diff,tab,dev
    justjavac
        4
    justjavac  
    OP
       2015-11-16 16:01:23 +08:00
    简直毁三观啊
    yougg
        5
    yougg  
       2015-11-16 16:07:07 +08:00
    为毛 没有 mnt, opt, srv, sys...
    squid157
        6
    squid157  
       2015-11-16 16:10:37 +08:00 via iPhone   ❤️ 5
    etc 不应该是 editable text configuration 什么的么
    frittle
        7
    frittle  
       2015-11-16 16:18:02 +08:00
    最初就是 user 的缩写。
    wy315700
        8
    wy315700  
       2015-11-16 16:23:53 +08:00
    这不是应该是常识吗,
    doublleft
        9
    doublleft  
       2015-11-16 16:28:03 +08:00   ❤️ 10
    想起来那个笑话: Bing 其实是 Bing is not Google 的缩写
    11138
        10
    11138  
       2015-11-16 16:36:28 +08:00
    是“ Unix System Resources ”吧。
    love
        11
    love  
       2015-11-16 16:41:57 +08:00
    我不信啊,开始应该是 user ,表示用户的文件。
    比如系统的执行文件在 /bin ,用户的 /usr/bin
    laoyur
        12
    laoyur  
       2015-11-16 16:45:06 +08:00
    @love 如果真是表示用户的文件,为嘛不是 /home/xxx ,这里才是真真正正的 user 呢
    wizardoz
        13
    wizardoz  
       2015-11-16 16:54:25 +08:00
    原来还真以为是 user 的缩写,你这么一说,觉得确实 /usr 目录和 user 没有半毛钱关系。
    love
        14
    love  
       2015-11-16 16:55:20 +08:00   ❤️ 2
    abcdabcd987
        15
    abcdabcd987  
       2015-11-16 16:55:37 +08:00
    etc 好敷衍啊
    Showfom
        16
    Showfom  
       2015-11-16 16:59:42 +08:00
    用户文件都在 /home/username 下啊
    laoyur
        17
    laoyur  
       2015-11-16 16:59:51 +08:00
    @love 好吧,你提供的链接的确如你所说:
    > 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.
    asj
        18
    asj  
       2015-11-16 17:03:58 +08:00   ❤️ 1
    @laoyur
    http://lists.busybox.net/pipermail/busybox/2010-December/074114.html

    You know how Ken Thompson and Dennis Ritchie created Unix on a PDP-7 in 1969?
    Well around 1971 they upgraded to a PDP-11 with a pair of RK05 disk packs (1.5
    megabytes each) for storage.

    When the operating system grew too big to fit on the first RK05 disk pack (their
    root filesystem) they let it leak into the second one, which is where all the
    user home directories lived (which is why the mount was called /usr). They
    replicated all the OS directories under there (/bin, /sbin, /lib, /tmp...) and
    wrote files to those new directories because their original disk was out of
    space. When they got a third disk, they mounted it on /home and relocated all
    the user directories to there so the OS could consume all the space on both
    disks and grow to THREE WHOLE MEGABYTES (ooooh!).
    znoodl
        19
    znoodl  
       2015-11-16 17:28:19 +08:00 via iPhone
    本来就不是 uaer ,用户的在 home 下, usr 一般放程序和文档相关,是共用的, opt 后来添加进去做安装程序用的
    abscon
        20
    abscon  
       2015-11-16 17:37:50 +08:00
    /usr/home/
    ericls
        21
    ericls  
       2015-11-16 17:39:58 +08:00
    你认为的 user 是 home 在 os x 下是 Users
    ericls
        22
    ericls  
       2015-11-16 17:42:51 +08:00
    不过很多缩写都是后来编的

    BYD 还是 build your dream 呢
    lightening
        23
    lightening  
       2015-11-16 17:45:35 +08:00   ❤️ 1
    crystom
        24
    crystom  
       2015-11-16 17:46:45 +08:00
    鸟哥的书里有提到 /usr 确实不是 user
    lyragosa
        25
    lyragosa  
       2015-11-16 17:59:36 +08:00
    世界观又刷新了。
    jhaohai
        26
    jhaohai  
       2015-11-16 18:02:57 +08:00 via iPhone
    我记得有本书里讲过, unix 资源最开始都是在根目录下,然后根目录用完了就新建了个存储挂在 /usr 下面,然后把根目录的结构在 /usr 里拷贝了一份
    lululau
        27
    lululau  
       2015-11-16 18:16:51 +08:00
    一开始以为 Unix Shared Resources 的缩写,后来才知道其实就是 user 的缩写。。。
    zzn
        28
    zzn  
       2015-11-16 18:41:36 +08:00
    想多了,就是 user
    Tiande
        29
    Tiande  
       2015-11-16 18:52:49 +08:00
    然而评论里仍有不明真相的群众。
    各位 HR 可以出面试题了。
    justjavac
        30
    justjavac  
    OP
       2015-11-16 19:07:44 +08:00 via Android
    @dtdnqsb 哈哈哈哈,面试题
    n6DD1A640
        31
    n6DD1A640  
       2015-11-16 19:14:53 +08:00
    就是 user
    ffffwh
        32
    ffffwh  
       2015-11-16 19:27:25 +08:00   ❤️ 1
    原来 cat 不是猫么
    FrankFang128
        33
    FrankFang128  
       2015-11-16 19:41:55 +08:00
    所以说:用 JB 缩写。
    FrankFang128
        34
    FrankFang128  
       2015-11-16 19:42:51 +08:00
    不应该是 user ,如果是的话,那么 root 就应该是 rt , bin 就是 bn
    Hello1995
        35
    Hello1995  
       2015-11-16 20:38:11 +08:00 via Android
    第一感理解为 user ,不过心存疑虑。 Linux 虽然是 UNIX-like ,但毕竟不是 Unix ,难道 Linux 下 /usr 也叫 Unix Shared Resources ?
    loading
        36
    loading  
       2015-11-16 20:51:08 +08:00 via Android
    还是用我的拼音首字母大法~

    免得你们又搞错
    wy315700
        37
    wy315700  
       2015-11-16 20:54:53 +08:00
    @Hello1995 Linux 就是用开源首发把 Unix 实现了一遍。。。
    Kirscheis
        38
    Kirscheis  
       2015-11-16 21:13:15 +08:00 via Android
    什么原来 cat 不是猫
    (゚(゚(゚(゚Д゚)!?
    Hello1995
        39
    Hello1995  
       2015-11-16 21:47:20 +08:00 via Android
    @Kirscheis 原来 man 不是男人 233333


    @wy315700 你没理解我的意思…
    orvice
        40
    orvice  
       2015-11-16 22:29:29 +08:00
    cat 竟然不是猫卧槽
    一直以为 unix 的哪些开发人员喜欢猫。。。
    MCVector
        41
    MCVector  
       2015-11-16 22:33:29 +08:00
    @doublleft gnu is not unix
    jiemoon
        42
    jiemoon  
       2015-11-16 22:45:04 +08:00
    心好累
    FreeDog
        43
    FreeDog  
       2015-11-16 22:57:58 +08:00
    一直以为 cat 是 conCATenate ,原来没有那个 con...
    killerv
        44
    killerv  
       2015-11-16 23:52:14 +08:00
    最初我也以为是 user ……
    raptor
        45
    raptor  
       2015-11-16 23:56:25 +08:00
    FreeBSD 的 user 目录就是在 /usr/home 下面…
    love
        46
    love  
       2015-11-17 00:01:49 +08:00 via Android
    @killerv 然后你看了这个帖子后认为不是 user 了?
    Orzpls
        47
    Orzpls  
       2015-11-17 00:03:55 +08:00 via Android
    是的, usr 只是简写。
    msg7086
        48
    msg7086  
       2015-11-17 02:20:20 +08:00
    @FrankFang128 因为古代键盘很难按,所以很多词都被缩写了以减少按键次数。
    典型的例子有 cp mv ls ln cat 这种常用的命令。
    deepreader
        49
    deepreader  
       2015-11-17 02:48:25 +08:00
    @FrankFang128
    @msg7086 是古时候为了字符省内存。

    但是如果英语学深了,发现省略元音的缩写在生活中其实是司空见惯的。
    lakeview
        50
    lakeview  
       2015-11-17 04:01:51 +08:00
    有意思,好像第一次知道,虽然用 Linux 这么多年了
    XDA
        51
    XDA  
       2015-11-17 08:13:54 +08:00 via Android
    鸟哥的书+1 ,另外再+Google
    vanxining
        52
    vanxining  
       2015-11-17 08:22:14 +08:00 via Android
    @msg7086 MSDOS 远在 Linux 之前,也没缩。
    onemoo
        53
    onemoo  
       2015-11-17 08:33:47 +08:00   ❤️ 2
    @vanxining 然而这些缩写源自 UNIX 时代
    tchekai704
        54
    tchekai704  
       2015-11-17 08:42:59 +08:00 via iPhone
    top 里面 cpu 的 sys 和 usr
    这里的 usr 难道不是 user 的意思吗???
    justjavac
        55
    justjavac  
    OP
       2015-11-17 08:50:57 +08:00
    @tchekai704 我的电脑上, top 怎么是 user 呢
    justjavac
        56
    justjavac  
    OP
       2015-11-17 08:53:00 +08:00
    kamil
        57
    kamil  
       2015-11-17 08:58:56 +08:00
    来看评论里“什么嘛,我早就知道”态度的人来装 x 的
    fengyqf
        58
    fengyqf  
       2015-11-17 09:11:27 +08:00
    @loading 说起汉语拼音,歪个楼:
    QB 是啥?
    fengyqf
        59
    fengyqf  
       2015-11-17 09:16:03 +08:00   ❤️ 1
    @vanxining MSDOS 确实在 linux 之前,但 MSDOS 远远在 UNIX 之后。 linux 是对 unix 的沿袭,命令当然要与 unix 一致了。
    其实我们说 linux 的时候,绝大多数都是指在其上运行的 gnu 软件
    fengyqf
        60
    fengyqf  
       2015-11-17 09:17:38 +08:00
    @tchekai704 我电脑上 top 里也是 USER
    server
        61
    server  
       2015-11-17 09:40:33 +08:00
    想起 09 年的时候,接手一个小程序的时候,用户表就是 usr_id ,看了好久才发现不是 user_id 。
    ivanlw
        62
    ivanlw  
       2015-11-17 10:11:55 +08:00
    如果是 user 的话,让 OS X 的 /Users 情何以堪……
    sox
        63
    sox  
       2015-11-17 10:43:51 +08:00
    user 已经够短了。。
    hjc4869
        64
    hjc4869  
       2015-11-17 10:54:32 +08:00 via iPhone   ❤️ 1
    @FrankFang128 我想起了 Documents and Settings
    jonnn
        65
    jonnn  
       2015-11-17 11:17:14 +08:00
    firesh
        66
    firesh  
       2015-11-17 11:27:39 +08:00
    长知识了
    kiwi95
        67
    kiwi95  
       2015-11-17 11:31:31 +08:00
    很明显这个目录跟 user 没什么关系,想想也知道不是 user
    catbaron
        68
    catbaron  
       2015-11-17 11:39:00 +08:00
    嗯……那 linux 下是不是应该叫 lsr
    smartdie
        69
    smartdie  
       2015-11-17 11:39:54 +08:00
    有个面试官还纠正过我这个念法,说“这个可不念 user ”,脸上一副“我放过地屁比你走过地路都多”的表情。
    finian
        70
    finian  
       2015-11-17 11:43:22 +08:00
    看评论里已经贴了相关链接,楼上那些还坚持说「本来就不是 user 」什么的也真是醉
    laoyur
        71
    laoyur  
       2015-11-17 11:47:55 +08:00
    @smartdie 求那个面试官的念法

    @finian 因为很多人不看或者说没耐心看那么多评论的
    ivenvd
        72
    ivenvd  
       2015-11-17 11:56:08 +08:00
    原来这么多火星人……
    carlhan
        73
    carlhan  
       2015-11-17 12:00:32 +08:00 via Android
    想知道 /opt 是什么的缩写
    smartdie
        74
    smartdie  
       2015-11-17 12:03:28 +08:00
    @laoyur 只是说我念 user 不对。没说应该怎么念。
    shanks
        75
    shanks  
       2015-11-17 13:09:04 +08:00
    原来你们都没看过鸟哥
    n6DD1A640
        76
    n6DD1A640  
       2015-11-17 13:09:41 +08:00
    @ivanlw OS X 只是沿袭 FreeBSD 的做法
    loading
        77
    loading  
       2015-11-17 13:13:26 +08:00 via Android
    @fengyqf 如果还有 GB 的话, QB 就是企标,企业标准, GB 是国标。这个我真的用过~
    htc502
        78
    htc502  
       2015-11-17 13:19:19 +08:00
    @carlhan 猜是 optional
    abscon
        79
    abscon  
       2015-11-17 13:29:40 +08:00 via iPhone
    @fengyqf “其实我们说 linux 的时候,绝大多数都是指在其上运行的 gnu 软件”
    ———————————————
    然而很多人都做不到这点。他们只是在 linux 上使用了某软件,就把这个软件叫做 linux 软件。

    如果按照你的这个规定,那么 Vim, OpenSSH, ZSH, Nginx, Apache, Python, PHP, Ruby, LLVM/Clang 等等等等都不是 Linux 软件了。我猜一定有人觉得它们是的,虽说它们的确不是。
    D3EP
        80
    D3EP  
       2015-11-17 16:01:56 +08:00   ❤️ 1
    Unix (包含 Linux )的初学者,常常会很困惑,不明白目录结构的含义何在。

    举例来说,根目录下面有一个子目录 /bin ,用于存放二进制程序。但是,/usr 子目录下面还有 /usr/bin ,以及 /usr/local/bin ,也用于存放二进制程序;某些系统甚至还有 /opt/bin 。它们有何区别?
    长久以来,我也感到很费解,不明白为什么这样设计。像大多数人一样,我只是根据《 Unix 文件系统结构标准》( Filesystem Hierarchy Standard ),死记硬背不同目录的区别。
    昨天,我读到了 Rob Landley 的简短解释,这才恍然大悟,原来 Unix 目录结构是历史造成的。
    话说 1969 年, Ken Thompson 和 Dennis Ritchie 在小型机 PDP-7 上发明了 Unix 。 1971 年,他们将主机升级到了 PDP-11 。

    当时,他们使用一种叫做 RK05 的储存盘,一盘的容量大约是 1.5MB 。

    没过多久,操作系统(根目录)变得越来越大,一块盘已经装不下了。于是,他们加上了第二盘 RK05 ,并且规定第一块盘专门放系统程序,第二块盘专门放用户自己的程序,因此挂载的目录点取名为 /usr 。也就是说,根目录"/"挂载在第一块盘,"/usr"目录挂载在第二块盘。除此之外,两块盘的目录结构完全相同,第一块盘的目录(/bin, /sbin, /lib, /tmp...)都在 /usr 目录下重新出现一次。
    后来,第二块盘也满了,他们只好又加了第三盘 RK05 ,挂载的目录点取名为 /home ,并且规定 /usr 用于存放用户的程序,/home 用于存放用户的数据。
    从此,这种目录结构就延续了下来。随着硬盘容量越来越大,各个目录的含义进一步得到明确。
      /:存放系统程序,也就是 At&t 开发的 Unix 程序。
      /usr :存放 Unix 系统商(比如 IBM 和 HP )开发的程序。
      /usr/local :存放用户自己安装的程序。
      /opt :在某些系统,用于存放第三方厂商开发的程序,所以取名为 option ,意为"选装"。

    来源: http://www.ruanyifeng.com/blog/2012/02/a_history_of_unix_directory_structure.html 阮一峰的网络日志
    D3EP
        81
    D3EP  
       2015-11-17 16:06:40 +08:00
    @finian 本来就不是 user 。是 Unix Software Resource.
    baiyemao
        82
    baiyemao  
       2015-11-17 16:25:32 +08:00
    我都糊涂了, cat 到底是不是猫呀。
    Daemon
        83
    Daemon  
       2015-11-17 16:34:52 +08:00
    我去 看了楼上的回复 到底是 user,还是 Unix Shared Resource???
    finian
        84
    finian  
       2015-11-17 16:52:06 +08:00
    @D3EP `第二块盘专门放用户自己的程序,因此挂载的目录点取名为 /usr` 请问这不是 user 是什么?

    然后你再看看其他人给的链接上的描述: http://www.tldp.org/LDP/Linux-Filesystem-Hierarchy/html/usr.html

    As such, some people may now refer to this directory as meaning 'User System Resources' and not 'user' as was originally intended.
    dandycheung
        85
    dandycheung  
       2015-11-17 18:25:53 +08:00
    据我之前的知识,说应该是 Unix Software Repository 。
    n6DD1A640
        86
    n6DD1A640  
       2015-11-17 18:50:10 +08:00
    @finian 233 ,论读英文原文的重要性。
    falcon05
        87
    falcon05  
       2015-11-17 19:44:28 +08:00 via iPhone
    fck 与 f*ck
    fengyqf
        88
    fengyqf  
       2015-11-17 22:22:21 +08:00
    @D3EP 联想到这篇文章了,想找到转来,但就是找不到,哈哈
    fengyqf
        89
    fengyqf  
       2015-11-17 22:25:42 +08:00
    @baiyemao
    $man cat

    ------------------------------------------------------
    CAT(1) User Commands CAT(1)

    NAME
    cat - concatenate files and print on the standard output

    SYNOPSIS
    cat [OPTION]... [FILE]...

    DESCRIPTION
    Concatenate FILE(s), or standard input, to standard output.
    ...
    ------------------------------------------------------
    gccplus
        90
    gccplus  
       2015-11-17 23:09:40 +08:00
    看过哪本书忘了是不是鸟哥的解释过 一开始应该就是 user 的缩写,而且一开始的功能就和现在的 home 差不都,后来功能变了——估计开源社区也就自圆其说一下吧。。。
    baiyemao
        91
    baiyemao  
       2015-11-18 02:46:31 +08:00
    @fengyqf 明白了。。。多谢
    imdoge
        92
    imdoge  
       2015-11-18 08:59:24 +08:00
    4 个字母为什么要缩写成 3 个字母…
    fengyqf
        93
    fengyqf  
       2015-11-18 10:34:59 +08:00
    @imdoge 大概是高频使用的东西,就缩写了。像一些超高频的命令,甚至缩写成 2 字母
    minsheng
        94
    minsheng  
       2015-11-18 12:56:31 +08:00 via iPhone
    @yylzcom 这里的 regular 是指 regular expression 所描述的是 regular language
    madshaw
        95
    madshaw  
       2015-11-18 21:19:45 +08:00
    @doublleft 不是 Baidu is not Google 么? 23333
    GNiux
        96
    GNiux  
       2015-11-30 00:05:17 +08:00 via iPhone

    你们都错了哈哈哈。看这里:

    https://wiki.debian.org/FilesystemHierarchyStandard

    /usr/
    Secondary hierarchy for shareable, read-only data (formerly from UNIX source repository, now from UNIX system resources)
    (files that are not-required to boot or rescue the system
    Balthild
        97
    Balthild  
       2015-12-12 00:22:00 +08:00 via Android
    @doublleft GNU is not Unix
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3605 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 47ms · UTC 10:28 · PVG 18:28 · LAX 03:28 · JFK 06:28
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.