1.网络
Linux 的软件安装目录是也是有讲究的,理解这一点,在对系统管理是有益的ide
/usr
:系统级的目录,能够理解为C:/Windows/
,/usr/lib
理解为C:/Windows/System32
。
/usr/local
:用户级的程序目录,能够理解为C:/Progrem Files/
。用户本身编译的软件默认会安装到这个目录下。
/opt
:用户级的程序目录,能够理解为D:/Software
,opt有可选的意思,这里能够用于放置第三方大型软件(或游戏),当你不须要时,直接rm -rf
掉便可。在硬盘容量不够时,也可将/opt单独挂载到其余磁盘上使用。工具
源码放哪里?
/usr/src
:系统级的源码目录。
/usr/local/src
:用户级的源码目录。测试
-----------------翻译-------------------ui
/optidea
Here’s where optional stuff is put. Trying out the latest Firefox beta? Install it to /opt where you can delete it without affecting other settings. Programs in here usually live inside a single folder whick contains all of their data, libraries, etc.
这里主要存放那些可选的程序。你想尝试最新的firefox测试版吗?那就装到/opt目录下吧,这样,当你尝试完,想删掉firefox的时候,你就可 以直接删除它,而不影响系统其余任何设置。安装到/opt目录下的程序,它全部的数据、库文件等等都是放在同个目录下面。
举个例子:刚才装的测试版firefox,就能够装到/opt/firefox_beta目录下,/opt/firefox_beta目录下面就包含了运 行firefox所须要的全部文件、库、数据等等。要删除firefox的时候,你只需删除/opt/firefox_beta目录便可,很是简单。
/usr/local操作系统
This is where most manually installed(ie. outside of your package manager) software goes. It has the same structure as /usr. It is a good idea to leave /usr to your package manager and put any custom scripts and things into /usr/local, since nothing important normally lives in /usr/local.firefox
这里主要存放那些手动安装的软件,即不是经过“新立得”或apt-get安装的软件。它和/usr目录具备相相似的目录结构。让软件包管理器来管理/usr目录,而把自定义的脚本(scripts)放到/usr/local目录下面,我想这应该是个不错的主意。
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------翻译
2.设计
Linux应用程序一般存放在系统为之保留的特定目录中。系统为正常使用提供的程序,包括用于程序开发的工具,均可在目录/usr/bin中找到;系统管理员为某个特定的主机或本地网络添加的程序一般可在目录/usr/local/bin或/opt中找到。
——摘自《Linux程序设计》
/proc目录包含了一些系统信息,驱动信息,内核信息
例如/proc/cpuinfo给出cpu信息