free 查閱記憶體。
uname 顯示系統相關資訊。
uptime 顯示目前系統已經開機多久時間。
dmesg 列出開機訊息。
[dywang@dywOffice ~]$ free -h
free: invalid option -- h
usage: free [-b|-k|-m|-g] [-l] [-o] [-t] [-s delay] [-c count] [-V]
-b,-k,-m,-g show output in bytes, KB, MB, or GB
-l show detailed low and high memory statistics
-o use old format (no -/+buffers/cache line)
-t display total for RAM + swap
-s update every [delay] seconds
-c update [count] times
-V display version information and exit
[dywang@dywOffice ~]$ free -tm
total used free shared buffers cached
Mem: 747 708 39 0 36 277
-/+ buffers/cache: 394 352
Swap: 1592 44 1548
Total: 2340 752 1587
# shared/buffers/cached 為己被使用的 Mem 中用來做為 緩衝及快取的量
# swap 最好不要被使用超過 20%
# 每秒更新 1 次共更新 3 次
[root@dywHome2 ~]# free -s 1 -c 3
total used free shared buffers cached
Mem: 1026908 933516 93392 0 66856 255544
-/+ buffers/cache: 611116 415792
Swap: 2120540 0 2120540
total used free shared buffers cached
Mem: 1026908 933532 93376 0 66856 255544
-/+ buffers/cache: 611132 415776
Swap: 2120540 0 2120540
total used free shared buffers cached
Mem: 1026908 933524 93384 0 66856 255544
-/+ buffers/cache: 611124 415784
Swap: 2120540 0 2120540
[dywang@dywOffice ~]$ uname --help
Usage: uname [OPTION]...
Print certain system information. With no OPTION, same as -s.
-a, --all print all information, in the following order:
-s, --kernel-name print the kernel name
-n, --nodename print the network node hostname
-r, --kernel-release print the kernel release
-v, --kernel-version print the kernel version
-m, --machine print the machine hardware name
-p, --processor print the processor type
-i, --hardware-platform print the hardware platform
-o, --operating-system print the operating system
--help display this help and exit
--version output version information and exit
Report bugs to <bug-coreutils@gnu.org>.
[root@dywOffice ~]# uname -s
Linux
[root@dywOffice ~]# uname -n
dywOffice
[root@dywOffice ~]# uname -r
2.6.17-5mdv
[root@dywOffice ~]# uname -v
#1 SMP Wed Sep 13 14:32:31 EDT 2006
# EDT : Eastern Daylight Time
# CEST: Central European Summer Time
[root@dywOffice ~]# uname -m
i686
[root@dywOffice ~]# uname -p
Intel(R) Pentium(R) 4 CPU 3.20GHz
[root@dywOffice ~]# uname -i
unknown
[root@dywOffice ~]# uname -o
GNU/Linux
[root@dywOffice ~]# uname -a
Linux dywOffice 2.6.17-5mdv #1 SMP Wed Sep 13 14:32:31 EDT 2006 i686
Intel(R) Pentium(R) 4 CPU 3.20GHz GNU/Linux
[dywang@dywOffice ~]$ uptime
13:21:38 up 35 days, 1:31, 1 user, load average: 0.00, 0.00, 0.00
# 後三項分別為 1, 5, 15 分鐘的平均負載
[dywang@dywOffice ~]$ dmesg > dmesg.txt
[dywang@dywOffice ~]$ vi dmesg.txt
練習題