shell 里使用 sed awk】的更多相关文章

http://www.cnblogs.com/chengmo/archive/2013/01/17/2865479.html 文件:datafileSteve Blenheim:238-923-7366:95 Latham Lane, Easton, PA 83755:11/12/56:20300Betty Boop:245-836-8357:635 Cutesy Lane, Hollywood, CA 91464:6/23/23:14500Igor Chevsky:385-375-8395:3…
http://blog.csdn.net/a81895898/article/details/8482387 Sed是什么 <sed and awk>一书中(1.2 A Stream Editor)是这样解释的: Sed is a "non-interactive" stream-oriented editor. It is stream-oriented because, like many UNIXprograms, input flows through the pr…
[root@room9pc01 ~]# seq 5 1 2 3 4 5 [root@room9pc01 ~]# seq 2 5 2 3 4 5 seq 1 2 10 1 3 5 7 9 [root@desktop0 ~]# seq 10 -2 1 10 8 6 4 2 /etc/profile #定义的系统变量文件…
Sed是什么 <sed and awk>一书中(1.2 A Stream Editor)是这样解释的: Sed is a "non-interactive" stream-oriented editor. It is stream-oriented because, like many UNIXprograms, input flows through the program and is directed to standard output. Sed本质上是一个编辑器,…
目录 1.文件管理-压缩与打包 2.用户管理 用户怎么查 如何创建用户 创建的用户信息都存储在哪? 用户存储密码的文件 如何为用户设定密码? 3.用户组 4.用户提权相关 5.Extra:额外补充 文件管理-压缩与打包 压缩包的两种格式:zip和tar.gz 1.什么是压缩包? 压缩包是一个特殊的文件,将多个文件和目录整合在一个文件中. 2.为什么要使用压缩包? 1.便于传输 2.压缩后的体积会变小 3.实现打包与压缩有哪些工具 windows: zip和tar linux:zip和tar.gz…
find :查找文件系统中指定的文件.可以按文件名(-name)  权限(-perm) 归属人 查找. find   要查找文件的路径   表达式 *通配符  可以添加在文件名的任意位置 常用的例子(具体可参照 find --help): find . -name 1.txt             在当前目录以及子目录下查找文件 1.txt find /tmp -name 1.txt       在/tmp目录以及子目录下查找文件 1.txt find /bin/ -perm 4755 | x…
1.Sed | Awk | Grep | Find 可以参考的文档链接 CentOS7 查看 当前机器 已经启动的端口的Shell命令: netstat -lntup | awk -F' ' {'print $4'} | awk -F':' {'print $2'}…
企业实战: 过滤ip 过滤出第二行的 192.168.2.11. eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.2.11 netmask 255.255.255.0 broadcast 192.168.2.255 ether 00:0c:29:41:85:df txqueuelen 1000 (Ethernet) RX packets 17934 bytes 9131091 (8.7 MiB) RX…
grep/sed/awk被称为linux的“三剑客” grep更适合单纯的查找或匹配文本: sed更适合编辑匹配到的文本: awk更适合格式化文本,对文本进行较复杂各式处理: Grep --color=auto 或者 --color:表示对匹配到的文本着色显示 -i:在搜索的时候忽略大小写 -n:显示结果所在行号 -c:统计匹配到的行数,注意,是匹配到的总行数,不是匹配到的次数 -o:只显示符合条件的字符串,但是不整行显示,每个符合条件的字符串单独显示一行 -v:输出不带关键字的行(反向查询,反…
今天在 SegmentFault 上看到又有人问起关于Shell里各种括号的问题.对于很多玩Shell的人,括号是个很尴尬的问题,用起来没问题,说起来不明白,我在这里总结一下Bash Shell几种括号的用法和区别,别的Shell我不会... (( )) :一对圆括号有两个地方用到. 1,for循环, for (( expr1 ; expr2 ; expr3 )) 这里一对双括号里边的表达式,GNU的文档指出,expr1支持 Shell Arithmetic:expr2不为0时,expr3被赋值…