solaris和linux命令对比
最近一个项目的系统用的是Solaris 10,虽然以前用的都是 Linux系统,但是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.1.127/24 broadcast 192.168.3.255
用ip如下:
# ip addr add 192.168.1.127/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.
相关文档:
准备工作:
用到的perl 扩展组件(modules)在上篇贴出.( win32::odbc 模块
)下载组件后按照Readme文件安装倒响应目录.配置好相应的odbc数据源.
程序实现:
使用
use
Win32::ODBC;
语句包含应使用的模块是win32::odbc,写出数据库
连接字符串
$DSN = "DSN =
My DSN ......
linux的进程间通信方式主要有:匿名管道、有名管道、消息队列、共享内存、信号、信号量及信号灯、socket网络通信。近日由于项目需要,用linux编写arm的应用程序,里面有几个功能模块,若干进程,进程间的通信方式选择了管道、共享内存和信号量的配合。这几天终于把程序的框架搭建好了,而我也对管道通信有了进一步的认识。
......
1. wrote driver function file(s) .
2. stored in the proper folder, eg: character driver stored in folder drivers/char/
3. modified Makefile in this folder(eg: drivers/char/)
-added configuration at somewhere: type like that "obj-$(CONFIG_TESTD ......
在应用程序开发时,也经常需要如下的定时器. 这里对定时器做了一个优化,就是在插入队列中时进行了一次排序,使得检测时不需要遍历整个链表,只需把排在前面的几个到时的任务取出来就可以了。
static struct timer_list {
long jiffies;
void (*fn)();
......