简体   繁体   English

结合两个查找命令 linux 的结果

[英]combining results of two find commands linux

I have a set of configuration backups that are organized like我有一组配置备份,其组织方式如下

backup/site1/10-11-2019
backup/site1/11-11-2019
backup/site1/12-11-2019

backup/site2/10-11-2019
backup/site2/11-11-2019
backup/site2/12-11-2019

backup/site3/10-11-2019
backup/site3/11-11-2019
backup/site3/12-11-2019

I need to list the configuration files that are less than specific size for one particular date for all sites.我需要列出所有站点的某个特定日期小于特定大小的配置文件。 In a way so that I could combine following two commands from backup directory在某种程度上,我可以结合备份目录中的以下两个命令

    find . -type d -name "11-11-2019"
    find . -name "*.cfg" -size +500c

Please help me combining these two commands请帮我结合这两个命令

Have you tried this?你试过这个吗?

find 11-11-2019 -name "*.cfg" -size +500c

Source: https://unix.stackexchange.com/questions/60849/find-files-in-multiple-folder-names来源: https://unix.stackexchange.com/questions/60849/find-files-in-multiple-folder-names

Can't check if it works right now:(无法检查它现在是否有效:(

Thanks for the link.感谢您的链接。 It gave me the hint to develop my command which serves my purpose.它给了我发展我的命令以达到我的目的的提示。

find . \( -type f -and -path '*/2019-11-11/*' \) -name "*.cfg" -size -50c -print

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM