上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 75 下一页
摘要: 在awk中执行外部命令 1、借助system/getline删除 awk '{cmd="rm "$0;system(cmd)}' filename awk '{cmd="rm "$0;cmd|getline }' filename man awk里面有关于getline的说明。 2、 awk '{system("wget -O - "url" | gre... 阅读全文
posted @ 2013-02-24 19:39 浪里飞 阅读(5462) 评论(0) 推荐(1) 编辑
摘要: 删除特殊大小的文件 1. 根据文件的时间,创建人,大小等特征,用find命令找到文件 find . -maxdepth 1 -type f -size +72019c -size -72021c 解释: -maxdepth 1 搜索深度为1 -type f 搜索普通文件 -size +72019c 文件大于72019byte ;-size -72021... 阅读全文
posted @ 2013-02-24 19:00 浪里飞 阅读(502) 评论(0) 推荐(0) 编辑
摘要: bash shell的命令分为两类:外部命令和内部命令。外部命令是通过系统调用或独立的程序实现的,如sed、awk等等。内部命令是由特殊的文件格式(.def)所实现,如cd、history、exec等等。 环境变量(传给子进程的变量,遗传性是本地变量和环境变量的根本区别)只能单向从父进程传给子进程。不管子进程的环境变量如何变化,都不会影响父进程的环境变量。 shell scrip... 阅读全文
posted @ 2013-02-24 18:36 浪里飞 阅读(810) 评论(0) 推荐(0) 编辑
摘要: shell中exec命令 1、find中的-exec参数 在当前目录下(包含子目录),查找所有txt文件并找出含有字符串"bin"的行 find ./ -name "*.txt" -exec grep "bin" {} \; 在当前目录下(包含子目录),删除所有txt文件 find ./ -name "*.txt" -exec rm {} \; Execu... 阅读全文
posted @ 2013-02-24 17:33 浪里飞 阅读(10875) 评论(0) 推荐(0) 编辑
摘要: volatile 影响编译器编译的结果,指出,volatile 变量是随时可能发生变化的,与volatile变量有关的运算,不要进行编译优化,以免出错,(VC++ 在产生release版可执行码时会进行编译优化,加volatile关键字的变量有关的运算,将不进行编译优化。)。 例如: volatile int i=10; int j = i; ... ... 阅读全文
posted @ 2013-02-24 17:10 浪里飞 阅读(636) 评论(0) 推荐(0) 编辑
摘要: struct linger TCP连接断开的时候调用closesocket函数,有优雅的断开和强制断开两种方式. 那么如何设置断开连接的方式呢?是通过设置socket描述符一个linger结构体属性。 linger结构体数据结构如下: struct linger { int l_onoff; int l_linger; }; 有三种组合方... 阅读全文
posted @ 2013-02-24 16:37 浪里飞 阅读(2477) 评论(0) 推荐(0) 编辑
摘要: 找到文件inode为31467125 并重命名。 find . -type f -inum 31467125 -exec mv {} new_name.html \; 找到指定inode并删除之 find . -type f -inum 314167125 -delete 找到相关文件,并删除;使用-print0和-0参数,避免某些文件中有包含有分隔符(如test m... 阅读全文
posted @ 2013-02-24 16:32 浪里飞 阅读(195) 评论(0) 推荐(0) 编辑
摘要: tcpdump抓取TCP标识位 按每8位组算,TCP的标志位位于第13个8位组中,如下,第一行一共32位是0 - 3个8位组,第二行是4-7八位组,第三行是8-11八位组,data offset +reserved的前四个是第12个8位组,reserved中的后2位+6个标志位是第13个八位组。 以下TCP报头 因此第13个八位组结构为 - - + + + +... 阅读全文
posted @ 2013-02-24 16:07 浪里飞 阅读(2035) 评论(0) 推荐(0) 编辑
摘要: curl命令简单使用 下载文件 curl -o 1.jpg http://cgi2.tky.3web.ne.jp/~zzh/screen1.JPG 批量下载 curl -o #2_#1.jpg http://cgi2.tky.3web.ne.jp/~{zzh,nick}/[001-201].JPG 续传 curl -c -O http://cgi2.tk... 阅读全文
posted @ 2013-02-24 15:41 浪里飞 阅读(285) 评论(0) 推荐(0) 编辑
摘要: 1、查看命令 [root@www ~]# sysctl -a | grep local 或cat /proc/sys/net/ipv4/ip_local_port_range 2、修改端口范围 1)永久修改 vi /etc/sysctl.conf 添加下面一行: net.ipv4.ip_local_port_range = 1024 65535 然... 阅读全文
posted @ 2013-02-24 15:22 浪里飞 阅读(598) 评论(0) 推荐(0) 编辑
上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 75 下一页