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信息