主題:
[分享]SYSTEM/PROC 的祕密
[打印本頁]
發表人:
result12
時間:
2007-11-28 01:30 AM
主題:
[分享]SYSTEM/PROC 的祕密
Linux kernel 的作用和重要性大家都知道
但大部分人可能不知道在 /proc 底下
大大小小的一堆虛擬目錄檔案代表著 kernel 的現狀
ls /proc 一下 會找到一大堆空檔案和資料夾
像 /cupinfo /diskstats /meminfo 等.....
雖然這裡大部分的檔案是 0 byte in size
但是還是可以使用 cat,more, less 等的指令去讀虛擬目錄檔案的內容
例
:/> less /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 15
model : 6
model name : Intel(R) Xeon(TM) CPU 3.00GHz
stepping : 4
cpu MHz : 3000.255
[url=cache size : 2048 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 2
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 6
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe lm constant_tsc pni monitor ds_cpl vmx est cid cx16 xtpr lahf_lm
bogomips : 6006.09
這樣大家就知道 cpuinfo 檔案裡是紀錄些什麼資訊了
其他還有更多有用的檔案
例.記憶體使用狀況 /proc/meminfo
linux kernel gcc 的版本 /proc/version
系統啟動多久(epoch time) btime
等.....
其他詳細的可以看這個
/proc man page
或
redhat manual
歡迎光臨 TWed2k (http://twed2k.org/)
Powered by Discuz! 4.1.0