2020年9月2日
摘要: 复制一个文件nfsclient.sh到主机172.18.117.162的/tmp目录下 scp -P22 /tmp/nfsclient.sh root@172.18.117.162:/tmp -P22 是指定端口(默认是22,遇到非默认端口情况需要指定端口); /tmp/nfsclient.sh 文 阅读全文
posted @ 2020-09-02 23:39 夏雨等秦天 阅读(531) 评论(0) 推荐(0) 编辑
摘要: 代码: find -type f ! -name "*.jpg" ! -name "*.png" ! -name "*.jpeg" ! -name "*.php" ! -name "*.txt" ! -name "*.php5" ! -name "*.asp" 阅读全文
posted @ 2020-09-02 23:29 夏雨等秦天 阅读(367) 评论(0) 推荐(0) 编辑
摘要: grep常见命令参数 -n 打印行号 grep -n ".*" h.txt 所有打印行号 grep -n "root" h.txt 匹配的内容显示行号 -v 不包括 -E 表示过滤 多个参数 grep -Ev "sshd|network|crond|sysstat|" -o:仅打印你需要的东西,默认 阅读全文
posted @ 2020-09-02 22:48 夏雨等秦天 阅读(493) 评论(0) 推荐(0) 编辑
摘要: 方法1: grep -E "^$" 1.txt | wc -l 详解:在网上摘抄,个人觉得不使用-E参数也行,利用正则^$可帅选出空行 方法2: file="1.txt" sed -n '/^$/p' 1.txt |wc -l 详解:-n选项:只显示匹配处理的行(否则会输出所有) 方法3: awk 阅读全文
posted @ 2020-09-02 22:13 夏雨等秦天 阅读(562) 评论(0) 推荐(0) 编辑