摘要:
需求: 将/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 阅读全文
摘要:
需求: 文件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 阅读全文
摘要:
发现某个程序的进程非常多,需要批量删除,如程序/usr/sbin/sendmail ps -ef|grep "/usr/sbin/sendmail"|grep -v grep |awk '{print $2}'|xargs kill 阅读全文