摘要: 需求: 将/home/log/下的所有.txt后缀的文件上传至sftp服务器中 方法: 1 #!/bin/bash 2 3 logdir="/home/log/" 4 sftpremote='172.29.251.11' 5 sftp_user='collection_log' 6 stp_port 阅读全文
posted @ 2020-06-18 16:38 小Q童鞋 阅读(2255) 评论(0) 推荐(0) 编辑
摘要: 需求: 文件A和文件B有重复的内容,需要将文件A中将这些重复的内容删除掉,并重新生成新的一份文件。 方法: 1、找出 A.txt 和 B.txt 重复的内容: cat A.txt B.txt |sort -n |uniq -d > same.txt 2、A.txt 去掉 same.txt的内容: c 阅读全文
posted @ 2020-06-18 16:27 小Q童鞋 阅读(900) 评论(0) 推荐(0) 编辑
摘要: 发现某个程序的进程非常多,需要批量删除,如程序/usr/sbin/sendmail ps -ef|grep "/usr/sbin/sendmail"|grep -v grep |awk '{print $2}'|xargs kill 阅读全文
posted @ 2020-06-18 16:16 小Q童鞋 阅读(542) 评论(0) 推荐(0) 编辑