find命令仅搜索非隐藏目录 [英] find command search only non hidden directories

查看:52
本文介绍了find命令仅搜索非隐藏目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在下面的命令中,我只想搜索非隐藏的目录。我如何使用以下命令执行此操作。我想在搜索日志文件时忽略隐藏的目录

In the following command i want to search only only the directories which are non hidden how can i do this using the following command .Iwant to ignore hidden directories while searching the log file

      find /home/tom/project/ -name '.log.txt'


   ls /home/tom/project/
   dir1
   dir2
   .backup
   .snapshot/
   .ignore/


推荐答案

尝试

find /home/tom/project -type d -name '.*' -prune -o -name .log.txt -print

这篇关于find命令仅搜索非隐藏目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆