码迷,mamicode.com
首页 > 其他好文 > 详细

exec命令

时间:2018-02-25 13:18:43      阅读:204      评论:0      收藏:0      [点我收藏+]

标签:log   host   time   name   rgs   -o   结束   命令   匹配   

exec解释:

find . -type f -mtime +14 -exec rm {} \; 

如上所示,-exec  后面跟要执行的命令,然后是{ },一个空格和一个\,最后是一个分号。 它的终止是以;为结束标志的,所以这句命令后面的分号是不可缺少的,考虑到各个系统中分号会有不同的意义,所以前面加反斜杠转义

{}   花括号里面传入find到的内容

 

1、exec安全删除模式  它将在对每个匹配到的文件进行操作之前提示你

[root@localhost] ~$ find . -name "*.txt" -ok rm {} \;
< rm ... ./xargs.txt > ? n
< rm ... ./temp.txt > ? n
< rm ... ./t t.txt > ? n
< rm ... ./out2.txt > ? n

 

exec命令

标签:log   host   time   name   rgs   -o   结束   命令   匹配   

原文地址:https://www.cnblogs.com/fanren224/p/8468872.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!