一些以前在bsd沒用過的指令或參數
看牛頭書順便紀錄一下~
指令:lspci
00:00.0 Host bridge: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX Host bridge (rev 01)
00:01.0 PCI bridge: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX AGP bridge (rev 01)
00:07.0 ISA bridge: Intel Corporation 82371AB/EB/MB PIIX4 ISA (rev 08)
00:07.1 IDE interface: Intel Corporation 82371AB/EB/MB PIIX4 IDE (rev 01)
00:07.2 USB Controller: Intel Corporation 82371AB/EB/MB PIIX4 USB
00:07.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 08)
00:0f.0 VGA compatible controller: VMware Inc [VMware SVGA II] PCI Display Adapter
00:10.0 SCSI storage controller: LSI Logic / Symbios Logic 53c1030 PCI-X Fusion-MPT Dual Ultra320 SCSI (rev 01)
00:11.0 Ethernet controller: Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE] (rev 10)
00:12.0 Multimedia audio controller: Ensoniq ES1371 [AudioPCI-97] (rev 02)
更詳細有lspcc -v ,lspci -vv
bash命令列的組合鍵
ctrl+a #移往列首
ctrl+e #移往列尾
ctrl+l #清除畫面
bash命令替換功能
example:
suse:~ # VAR=$(uname -a)
suse:~ # echo $VAR
Linux suse 2.6.18.2-34-default #1 SMP Mon Nov 27 11:46:27 UTC 2006 i686 athlon i386 GNU/Linux
cut指令
example:
suse:~ # cut -d: -f1 /etc/passwd
跟awk很像!我想cut比較好用...
join指令
example:
suse:~ # cat t1
b a 1
c d 2
suse:~ # cat t2
x y 1
y x 2
suse:~ # join -j 3 t1 t2
1 b a x y
2 c d y x
t2如果把數字順序換掉就不行了,果然join還沒那麼聰明
sort指令
example:
suse:~ # cat /etc/passwd | sort -t: -k3
suse:~ # cat /etc/passwd | sort -t: -k3 -n
-n是以"數字"來排序,如果沒有加上-n,則以第一個字母來排序
tac指令
example:
suse:~ # tac /var/log/messages | less
以前看log都用tail -f,現在才知道可以由下往上看,不錯!
du指令
example:看各目錄使用量
suse:~ # du -csh /*
259M /proc
108K /root
12M /sbin
1.4M /srv
4.0K /subdomain
65M /swapfile
0 /sys
124K /tmp
2.0G /usr
206M /var
3.6G total
增加硬碟
ls -al /dev/ | grep sd*
使用fdisk工具,分割完後用mkfs格式化
mkfs -t ext3 -q /dev/sdb1
看來有必要瞭解一下/etc/fstab各項參數
參考來源:
http://www.skullbox.net/newsda.php
改網卡設定
/etc/sysconfig/network-scripts/
改dns
/etc/resolv.conf
