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

来源:互联网 发布:java技术手册 第6版 编辑:程序博客网 时间:2024/05/08 18:26

来源:http://blog.csdn.net/champgauss/article/details/43306093

/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.
--------------------------------------------------------

来源:http://justcoding.iteye.com/blog/2010809


http://justcoding.iteye.com/blog/2010809