/bin /sbin/ /usr/bin/ /usr/loca/bin/ 各目录的区别

/bin和/sbin 用于放置一些根分区(/)上的程序,以便在/usr分区挂载之前就可以使用。虽然现在该路径基本只作为一些关键程序(如/bin/sh)的标准路径,但在一些小型嵌入式设备上还是有这样的用法


/sbin/与bin的区别在于,sbin是存放系统管理程序的路径(普通用户一般不用)


/usr/bin用于分发包管理器(如Ubuntu apt等)存放它所管理的应用的路径, /usr/sbin与/usr/bin的关系类似与/bin和/sbin的关系


/usr/local/bin用于存放用户自己的程序(如自己编译出来的包等),不受分发包管理器的控制。如果用户把自己的程序放在/usr/bin下,则有可能在未来被包管理器给修改或删除了。


http://unix.stackexchange.com/questions/8656/usr-bin-vs-usr-local-bin-on-linux


/bin (and /sbin) were intended for programs that needed to be on a small / partition before the larger /usr, etc. partitions were mounted. These days, it mostly serves as a standard location for key programs like /bin/sh, although the original intent may still be relevant for e.g. installations on small embedded devices.

/sbin, as distinct from /bin, is for system management programs (not normally used by ordinary users) needed before /usr is mounted.

/usr/bin is for distribution-managed normal user programs.

There is a /usr/sbin with the same relationship to /usr/bin as /sbin has to /bin.

/usr/local/bin is for normal user programs not managed by the distribution package manager, e.g. locally compiled packages. You should not install them into /usr/bin because future distribution upgrades may modify or delete them without warning.

/usr/local/sbin, as you can probably guess at this point, is to /usr/local/bin as /usr/sbin to /usr/bin.

In addition, there is also /opt which is for monolithic non-distribution packages, although before they were properly integrated various distributions put Gnome and KDE there. Generally you should reserve it for large, poorly behaved third party packages such as Oracle.



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值