把/etc/passwd 复制到/root/test.txt,用sed打印所有行;2. 打印test.txt的3到10行;3. 打印test.txt 中包含’root’的行;4. 删除test.txt 的15行以及以后所有行;5. 删除test.txt中包含’bash’的行;6. 替换test.txt 中’root’为’toor’;7. 替换test.txt中’/sbin/nologin’为’/b
grep 正则表达式1 基础的正则表达式 1 ^word 表示搜索以word 开头的内容 2 word$ 表示搜索以word结尾的内容 3 ^$ 表示空行,不是空格 4 . 代表且只能代表任意一个字符 5 \
awk 用法:awk -F 参数用法:指定分隔符我的源文档:more domain.loghttp://www.baidu.com/index.htmlhttp://www.google.com/1.htmlhttp://www.baidu.com/1.html[root@mysql ~]# awk -F "/" '{print $3}' domain.log www.ba
Copyright © 2005-2025 51CTO.COM 版权所有 京ICP证060544号