常用 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
&
相关文档:
Service Discovery Protocol(SDP)提供一种能力,让应用程序有方法发现哪种服务可用以及这种服务的特性。
服务发现协议(SDP或Bluetooth SDP)在蓝牙协议栈中对蓝牙环境中的应用程序有特殊的含意,发现哪个服务是可用的和确定这些可用服务的特征。SDP定义了bluetooth client发现可用bluetooth server服务和它们的特征的方法。 ......
linux对挂接在4G总线空间上的设备实体的管理方式 -- struct resource /usr/src/linux-2.6.21.5/include/linux/ioport.h struct resource { resource_size_t start; resource_size_t end; const char *name; unsigned long flags; struct resource *parent, *sibling, *child; }; struct resource_list { struct resource_li ......
linux目录架构
/ 根目录
/bin 常用的命令
binary file 的目錄
/boot 存放系统启动时必须读取的档案,包括核心
(kernel) 在内
/boot/grub/menu.lst GRUB设置
/boot/vmlinuz 内核
......
细心的朋友会注意到,当你在Linux下频繁存取文件后,物理内存会很快被用光,当程序结束后,内存不会被正常释放,而是一直作为caching.这个问题,貌似有不少人在问,不过都没有看到有什么很好解决的办法.那么我来谈谈这个问题.
先来说说free命令
[root@server ~]# free -m
total used free shared buffers cached
Mem: 249 16 ......
来自: 杨志刚 博客 (http://yangzhigang.cublog.cn
)
在windows下,一个文件有:创建时间、修改时间、访问时间。
而在Linux下,一个文件也有三种时间,分别是:访问时间、修改时间、状态改动时间
。
两者有此不同,在Linux下没有创建时间的概念
,也就是不能知道文件的
建立时间,但如果文件建立后 ......