B Solaris 常用命令及例子( 二 )


#./install


参数 功能
-B 指定存储恢复现场信息的目录,而不是默认目录
-C 如果需要,指定需要打补丁的网络安装映象的路径
-d 不接受可恢复现场的补丁安装
-M 指定定位补丁的可选目录
-p 打印所有已安装的补丁列表
-u 不让文件安装生效
-R 为客户安装指定可选根目录
-S 从服务器为客户端安装补丁,客户机共享服务器操作系统目录


patchrm
#patchrm patchname // 删除补丁
#patchrm -C /export/Solaris_2.9/tools/1065-15
//从客户端系统删除补丁

引导和启动过程、ok模式
#shutdown
#reboot
#init 0
#boot -r

ok setenv boot-device disk //将默认的启动设备改为disk
boot-device = disk

ok printenv boot-device //验正启动设备
boot-device disk disk

ok reset

ok test net //测试回路网络设备
ok watch-clock //测试时钟设备
ok boot -r //重新引导系统
ok boot net //从网络启动
ok boot cdrom //从光盘启动
ok boot floppy //从软盘启动
ok boot tape //从磁带引导系统
ok watch-net //检查网络是否联通
ok probe-scsi //检查系统检测出的所有磁盘设备,并得到可用的设备列表
ok banner //检测内存、系统固件的openboot版本信息
ok boot -s //进入单用户模式
#reboot -l -- -r //重新引导不在系统日记里记录
#shutdown - i 0 -g 120 -y
#sync;init 0
#traceroute www.abc.com


wall
#wall

init
#init q //重新初始化运行级别
#init 0 //硬件维护模式
#init 1 //单用户模式
#init 2 //NFS不可用
#init 3 //NFS可用
#init 4 //用户定义状态
#init 5 //关闭系统电源
#init 6 //挂起操作系统
#init s //进入管理状态

网络配置

etc/hostname.interface //是这块网卡的名字或机器的名字
# cat hostname.pcn0
wing

# cat hosts
#
# Internet host table
#
127.0.0.1 localhost
192.168.0.11 wing
# hostname
wing

# cat netmasks
192.168.0.0 255.255.255.0

#ifconfig le0 172.16.255.1 netmask 255.255.255.0

配置网络端口状态
#ifconfig le0 up/down
配置网络端口是否可用
#ifconfig le0 plumb/unplumb
#ifconfig -a 这个地址只有root用户使用时才显示 。如果一个非root用户使用ifconfig命令,那么只有IP地址
# ifconfig -a
lo0: flags=1000849 mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
hme0: flags=1000843 mtu 1500 index 2
inet 192.168.10.25 netmask ffffff00 broadcast 192.168.10.255
ether 8:0:20:a2:11:de
#

#ifconfig le0 192.168.0.3 netmask 255.255.255.0 broadcast 192.168.0.255 up
banner
你也可以在系统还没有启动时在ok提示符下敲入banner来找到Mac地址,CPU 型号和频率 。
ok banner

un Ultra 5/10 UPA/PCI (UltraSPARC-IIi 300MHz), Keyboard Present
OpenBoot 3.1.1 64 MB memory installed, Serial #9361102.
Ethernet address 8:0:20:8e:d6:ce, HostID: 808ed6ce.


# arp -a //登陆用户

Net to Media Table: IPv4
Device IP Address Mask Flags Phys Addr
------ -------------------- --------------- ----- ---------------
pcn0 192.168.0.1 255.255.255.255 00:03:0f:fd:6d:0c
pcn0 wing 255.255.255.255 SP 00:0c:29:19:a1:54
pcn0 224.0.0.0 240.0.0.0 SM 01:00:5e:00:00:00


# netstat // 网络状态

TCP: IPv4
Local Address Remote Address Swind Send-Q Rwind Recv-Q State
-------------------- -------------------- ----- ------ ----- ------ -------
wing.telnet 192.168.0.1.1030 7168 0 66608 0 ESTABLISHED
wing.telnet 192.168.0.1.1032 6253 1 66608 0 ESTABLISHED

Active Unix domain sockets
Address Type Vnode Conn Local Addr Remote Addr
df187cc0 stream-ord dee4c1c0 00000000 /tmp/.X11-unix/X0
df187de8 stream-ord 00000000 00000000
#

推荐阅读