free命令查看系统内存使用情况。
top -- displaylinux tasks.
在进程挂掉或系统不稳定等情况下常使用。
ranlib命令 -- 生成索引以加快对文件的访问 ranlib file.只有-v -h参数
you may use nm-s to list this index.
an archive withsuch an index speeds up linking to the library and allows routines in thelibrary to call each other without regard to their placement in the archive.
在打包静态库文件时常使用。
$make2>&1 | tee xxx.log
编译并保存打印信息。shell中定义0表示标准输入,1表示标准输出,2表示标准出错信息输出。2>&1表示把2设备信息重定向到1设备,tee是创建文件并保存信息的工具。
tee -- copystandard input to a file, and also to standard output.
time - time asimple command or give resource usage
The time command runs the specified programcommand with the given arguments. Whencommand finishes, time writes a message to standard output giving timingstatistics about this program run.
可以使用time命令检测程序的执行效率问题。
printk保存在/var/log/messages
dmesg --print orcontrol the kernel ring buffer
显示开机信息。kernel会将开机信息存储在ring buffer中。开机信息亦保存在/var/log目录中名称为dmesg的文件里。
在驱动程序中添加打印信息,在系统加载驱动时就可使用dmesg测试系统是否正确加载驱动。
使用dmesg查看最后几行
dmesg |tail -n x
dmesg –n 8 可将所有级别的信息打印出来
killall -9process
9是一个信号代码,用来结束一个进程。
HUP信号,一般来说程序在收到这个信号后都会去重新读取配置信息。你可以发一个HUP消息给进程,再很多进程中,收到HUP消息就表示要求进程重新读取配置。
使用kill发HUP命令给进程,假设进程号为n:
kill -HUP n
可以使用kill及killall命令测试程序的信号处理能力。
取消网络接口的静态ip地址
ifconfig eth00.0.0.0
路由表项的操作(对象为静态路由表项,Linux-2.2之后的内核中维护多张路由表)
route add -net192.168.1.0 netmask 255.255.255.0 dev eth1
route del -net192.168.1.0 netmask 255.255.255.0 dev eth1
route deldefault netmask 0.0.0.0 dev xxx