![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
脚本语言
文章平均质量分 74
袁牛飞
linux运维初初级
展开
-
Linux Shell脚本攻略笔记1之牛刀小试
echo 使用转义字符 $ echo -e "a\tb\tc\n" a b c 打印颜色 $ echo -e "\e[1;31m This is red txt. \e[0m" This is red txt. 注:重置=0,黑色=30,红色=31,绿色=32 ... 黄蓝洋红青白原创 2016-06-14 00:06:59 · 337 阅读 · 0 评论 -
Linux Shell脚本攻略笔记2之命令之乐
cat 文件拼接 cat 1.txt 2.txt 摆脱多余空白行 $ cat -s ss.tst 或者tr $ cat ss.tst |tr -s '\n' 显示行号 -n $ cat -n ss.tst 录屏 $ script -t 2> ti原创 2016-06-14 00:08:17 · 387 阅读 · 0 评论 -
Linux Shell脚本攻略笔记3之以文件为名
dd 创建指定大小文件 $ dd if=/dev/zero of=junk.data bs=1M count=1 -rw-rw-r-- 1 stu2452 stu2452 1048576 Jun 14 06:48 junk.data 字节c, 字w, 块b, k, M, G comm $ comm A.txt B.txt 第一列A有的,第二列B有的,第三列AB共有的 打印交原创 2016-06-14 19:38:02 · 554 阅读 · 0 评论 -
Linux Shell脚本攻略笔记4之让文本飞
grep -E 拓展 == egrep $ grep -E "[a-z]+" filename -v 反向匹配 -c 统计匹配行数并非次数 $ echo -e "1 2 3 4\nhello\n5 6"|grep -c "[0-9]" --> 2 l$ echo -e "1 2 3 4\nhello\n5 6"|grep -o "[0-9]" |wc -l 匹配原创 2016-06-14 19:39:15 · 369 阅读 · 0 评论