使用找到-exec {},是有办法的总数
问题说明
我使用类似这样的命令:
I am using a command similar to this one:
find . -name "*.php" -exec chmod 755 {} \;
虽然,我没有使用chmod,我使用的是不同的命令,我不会在这里列出。此命令工作正常。但是,也有成千上万的文件和目录来进行操作,并且该操作需要花费一些时间。我想知道,如果有显示某种共有当操作完成的方法吗?也许是修改过的文件的计数?
Although, I am not using chmod, I am using a different command which I will not list here. This command is working fine. However, there are thousands of files and directories to be operated on, and this operation takes some time. I am wondering if there is a way to display some sort of total when the operation is complete? Perhaps a count of modified files?
我能想到的唯一的事情很简单,就是做这样的事情:
The only thing I can think of is simply to do something like:
find . -name "*.php" -exec chmod 755; echo " "; {} \;
请问这项工作?至少我们可以看到,事情正在发生...任何人有更好的建议?
Will that work? At least we can see that something is happening... Anyone have a better suggestion?
正确答案
这个作品:
$ find . -name "*.php" -exec chmod 755 {} \; -exec /bin/echo {} \; | wc -l
您必须包括第二 -exec /斌/回声
这个工作。如果找到
命令没有输出,则厕所
没有输入计数线。
You have to include a second -exec /bin/echo
for this to work. If the find
command has no output, then wc
has no input to count lines for.
这篇好文章是转载于:学新通技术网
- 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
- 本站站名: 学新通技术网
- 本文地址: /reply/detail/tanhcfjjfb
-
YouTube API 不能在 iOS (iPhone/iPad) 工作,但在桌面浏览器工作正常?
it1352 07-30 -
iPhone,一张图像叠加到另一张图像上以创建要保存的新图像?(水印)
it1352 07-17 -
保持在后台运行的 iPhone 应用程序完全可操作
it1352 07-25 -
使用 iPhone 进行移动设备管理
it1352 07-23 -
在android同时打开手电筒和前置摄像头
it1352 09-28 -
扫描 NFC 标签时是否可以启动应用程序?
it1352 08-02 -
检查邮件是否发送成功
it1352 07-25 -
Android微调工具-删除当前选择
it1352 06-20 -
希伯来语的空格句子标记化错误
it1352 06-22 -
Android App 和三星 Galaxy S4 不兼容
it1352 07-20