希望有人可以帮助这个:
尝试使用此命令删除/ tmp上的会话文件:
find /tmp -name 'sess_*' -user Username -maxdepth 1 $CMD {} \;
但是我收到以下错误:
find: warning: you have specified the -maxdepth option after a
non-option argument -name,but options are not positional (-maxdepth
affects tests specified before it as well as those specified after
it). Please specify options before other arguments.06001
我通过网络寻找解决方案,但找不到任何解决方案.我已经删除其他tmp文件与其他命令,并怀疑是否影响一些卷或套接字.
先谢谢你
解决方法
find有三种类型的选项:用于匹配文件的选项(例如-name,-user),指定在匹配文件(-print,-exec)上执行的操作的选项以及控制整个行为的选项命令(例如-maxdepth,-xdev).第三种必须放在另外两种之前.所以应该是:
find /tmp -maxdepth 1 -name 'sess_*' -user Username -exec $CMD {} \;
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。