- 博客(4)
- 资源 (4)
- 收藏
- 关注
原创 Shell文本处理 (4) sed、awk、diff、patch、
1、行操作 sedcat txt | sed '2d‘ // 删除第2行cat txt | sed '2,5d’ // 删除第2-5行'cat txt | sed '2,$d‘ // 删除第2到最后1行cat txt | sed '2a hhhhhhh' // 第2后加上一行hhhhhhhcat tx
2015-02-19 19:26:51 558
原创 Shell文本处理 (3) grep 正则表达式
grep 't[ae]st' myTxt // 查找 tast 或testgrep '[^g]oo' myTxt // 查找含有oo,但前面没有ggrep '[^a-zA-Z]oo' myTxt // 查找含有oo,但前面没有字母grep '^the' myTxt // 查找the开头grep '^[a-z]'
2015-02-19 18:14:50 354
原创 Shell文本处理 (2). cut、sort、wc、uniq、tr、 join、paste、 split、xargs
1、切分提取 cut用":"切分[admin@VA128 ~]$ echo $PATH/opt/phoenix/bin:/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/vmware/bin:/usr/java/jre-vmware/bin:/opt/vmwar
2015-02-19 17:49:39 450
原创 Shell文本处理 (1). bash命令杂项
1、变量取消unset[admin@VA128 ~]$ myVar='hahahaha'[admin@VA128 ~]$ echo $myVarhahahaha[admin@VA128 ~]$ unset myVar[admin@VA128 ~]$ echo $myVar2、单双引号区别单引号与双引号区别。单引号内部的$变量不替换,双引号内部的变量替换。
2015-02-19 17:11:15 409
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人