跳至主要内容

Linux&Solaris

1) 查看开放端口
Linux: netstat -atn
Solaris: netstat -P tcp -f inet -an

2) 查看网卡/网络状态
Linux: ifconfig
Solaris: ifconfig -a 或者 dladm show-dev等
注1:Linux下每个网卡都是以eth0,eth1等来命名的,而Solaris则是以网卡驱动来命名的,如rtls0, iprb0, bge0, bge1,bnx0,e1000g1,nge1,xge0等,可以通过man来查看究竟是什么网卡,比如:
# man iprb
注2:Linux在逐渐淘汰ifconfig命令,取而代之是功能更强调的iproute或者叫iproute2软件包,主要命令有ip和tc。用ifconfig给网卡添加另外一个ip,命令如下:
# ifconfig eth0:0 192.168.3.15/24 broadcast 192.168.3.255
用ip如下:
# ip addr add 192.168.3.15/24 broadcast 192.168.3.255 dev eth0

3) 查看系统安装的所有软件包
Linux: rpm -qa 或者 dpkg-query -l
Solaris: pkginfo

4) 安装软件包
Linux: rpm -ivh stardict.rpm
Solaris: pkgadd -d `pwd` SUNWstardict

5) 卸载软件包
Linux: rpm -e stardict
Solaris: pkgrm SUNWstardict

6) 查看软件包的所有安装文件
Linux: rpm -ql stardict
Solaris: pkgchk -l SUNWstardict | grep Pathname

注:在Solaris上还可以根据某一个文件来判断该文件属于哪一个安装包
# pkgchk -lp /usr/share/stardict/sounds/menushow.wav
Pathname: /usr/share/stardict/sounds/menushow.wav
Type: regular file
Expected mode: 0644
Expected owner: root
Expected group: bin
Expected file size (bytes): 6250
Expected sum(1) of contents: 60494
Expected last modification: Jul 18 11:26:00 2006
Referenced by the following packages:
SUNWstardict
Current status: installed
今天发现rpm也可以实现此功能
# rpm -qf /bin/ls
coreutils-6.4-10

7) 查看进程状态
Linux: top
Solaris: prstat
在Solaris下可以通过pkg-get -i top来下载安装top软件,prstat -L可以进一步显示每个线程的状态

8) 查看系统服务
Linux: chkconfig --list或者chkconfig -L
Solaris: svcs

9) 系统服务管理
Linux: chkconfig samba off或者chkconfig samba on
Solaris: svcadm ensable svc:/network/smtp:sendmail或者svcadm enable svc:/network/smtp:sendmail
Solaris的svcadm可以通过-r参数进一步把相关的服务开启或者禁止掉

10) 查看CPU信息
Linux: more /proc/cpuinfo
Solaris: psrinfo -v或者psrinfo -vp

11) 查看内存大小
Linux: more /proc/meminfo或者top
Solaris: prtconf | grep ^M

12) 监测网络
Linux: tcpdump
Solaris: snoop

13) 显示所有模块信息
Linux: lsmod
Solaris: modinfo
注:Linux也支持modinfo,但是只显示某个模块信息,如
# modinfo fat

14) 插入模块
Linux: insmod/modprobe
Solaris: modload

15) 卸载模块
Linux: rmmod
Solaris: modload
注:Solaris每个模块都有一个整数编号,要卸载需指定编号
# modinfo | grep bge
174 ffffffffeff63000 12150 162 1 bge (BCM579x driver v0.51)
# modunload -i 174

16)查看pci设备
Linux: lspci -vn
Solaris: prtconf -vp

17)给网卡添加额外的IP地址
Linux: ifconfig eth0:1 192.168.3.15
Solaris: ifconfig e1000g addif 192.168.3.15/24 up

评论

此博客中的热门博文

Python学习笔记20100117

映射list   Dictionary 是用{}. list 是一那个[]. turple是用() 当你定义过dictionary后,你可以使用d.keys(), d.values(),d.items()将定义后的时候分别显示出来 当然可以将list里的值加减乘除,也可以如一般的定义直接重新复制这个list. 链接与分割字符串的 li=";", join(li) 则显示的就是 分隔符为;的数 如果使用li=li.split(";")则将刚刚;的分隔符删除,而split里也可定义域,如li.split(";",1)   自省 <---这是啥 之前在使用的时候发觉有些书本上的模块不能调用,很多是py脚本定义过的函数。 下载该脚本s,然后上传至指定位置。 >>>import sys >>>sys.path >>>sys.path.append("绝对位置")然后就能调用这些脚本和参数了。 删除 >>>sys.path.pop() 定义一个参数是 def info(test, test1=10.test2=12): info是函数名,test是必备参数,因为没有定义值,test1和test2是可选参数,定义了初始值   以上是外部函数的调用,下面转到内部函数 内部函数有type,str,dir及其他   ---type 返回任意字符的类型,模块也可以。types模块 >>> type(1) <type 'int'> >>> li=[] >>> type(li) <type 'list'> >>> import odbchelper >>> type(odbchelper) <type 'module'> >>> type(sys) <type 'module'> >>> import types ...

Setagaya park

  We visited Setagaya Park (世田谷区) yesterday. This park reminds us when we in Europe, which has a fancy fountain in the middle, and free entrance. People just laid down on the grass, enjoy the day time they can waste. people who have kids together,  play all different kinds of sports. you really can't image whether you are in Europe or  Japan. I would prefer to use a Bus instead of the metro, the metro is fast, but you only can see the dark, light, people sit or stand as Sardine, without any emotion. but on the bus, you can see the traffic, the shop, everything on the road. When we on our way to the park, we stop by a good chocolate shop named " craft chocolate works ",  this is a very good place to have ice cream, you probably can choose half & half, you can enjoy the feeling when you smell the chocolate smell and eat with it.  or you can enjoy beer or cake in "globe antiques (ザ グローブアン ティ ークス) .   also, we checked the Blue Bottle Coffee Sangenjaya ...