常用 Unix/Linux shell 命令
关键字: shell
转自:http://fanqiang.chinaunix.net/program/code/2006-06-27/4695.shtml
Ruby代码
删除 core 文件
# find ~ -name core -exec file {} \; -exec rm -i {} \;
查看使用文件的进程
# fuser -u /usr/my_application/foo
搜索字符串
#grep "hello world" `find ./ -name "*" -print -exec file {} \; |grep text | cut -d ':' -f 1`
目录
#alias dir='ls -Lla|grep ^d'
输出 IP 地址
#ifconfig | grep "inet addr" | grep -v "127.0.0.1" | awk '{print $2;}' | awk -F':' '{print $2;}'
按文件长度排序
#ls -l | grep ^- | sort -nr -k 5 | more
#ls -lR | grep ^- | sort -nr -k 5 | more
二进制文件中的可打印字符
# strings name of binary file
一个月的最后一个星期天执行任务:
18 * * * 0 [`date "+%d"
` -gt 24] && /path/to/script
修改扩展名:
# for f in *.abc; do mv $f `basename $f .abc`.def ; done
查看硬盘情况:(Solaris)
# iostat -En
&
相关文档:
参考出处:一步步教你交叉编译嵌入式linux GUI-directfb+gtk
一、注意点:
1、在./configure的--host的选项可以为arm-linux或arm-none-linux-gnueabi(编译工具cross-4.3.2,也是本次用的编译工具,在安装目录下的/bin文件夹里可以用ls -l看到编译工具除了arm-linux-gcc和arm-none-linux-gnueabi-gcc,arm-linux-g+ ......
安装.src.rpm
有些软件包是以.src.rpm结尾的,这类软件包是包含了源代码的rpm包,在安装时需要进行编译。这类软件包有两种安装方法:
方法一:
1. 执行rpm -i your-package.src.rpm
2. cd /usr/src/redhat/SPECS
3. rpmbuild -bp your-package.specs 一个和你的软件包同名的specs文件
4. cd /usr/sr ......
1、打开终端,切换到root用户,输入:free -m查看内存状态
[root@lxt lxt]# free -m
total used free shared buf ......
来自: 杨志刚 博客 (http://yangzhigang.cublog.cn
)
在windows下,一个文件有:创建时间、修改时间、访问时间。
而在Linux下,一个文件也有三种时间,分别是:访问时间、修改时间、状态改动时间
。
两者有此不同,在Linux下没有创建时间的概念
,也就是不能知道文件的
建立时间,但如果文件建立后 ......