finddir-iregex".*\.log"|xargsrm-rf.先用find命令找到指定目录下以log结尾的所有文件的全路径,然后用xargs把结果传递给rm命令的输入参数,然后用rm命令删除就可以了。