gpt4 book ai didi

unix - grep:警告:递归目录循环

转载 作者:行者123 更新时间:2023-12-02 01:54:16 26 4
gpt4 key购买 nike

我正在使用 Xshell ssh Unix 服务器,并且我正在尝试搜索包含特定文本的文件..

我使用的命令是:grep -ilr "blah_blah_text"./

它找到了我正在寻找的内容,但它也给出了这些警告:

grep: warning: ./svn/pages/dvorak/xhtml/mh370/ocean/dvorak/found: recursive directory loop

grep: warning: ./svn/pages/dvorak/xhtml/mh370/ocean/dvorak/testing/sea: recursive directory loop

grep: warning: ./svn/pages/dvorak/xhtml/mh370/ocean/dvorak/testing/found: recursive directory loop

grep: warning: ./svn/pages/dvorak/xhtml/mh370/ocean/testing/dvorak/found: recursive directory loop

grep: warning: ./svn/pages/dvorak/xhtml/mh370/ocean/testing/dvorak/monday: recursive directory loop

grep: warning: ./svn/pages/dvorak/xhtml/mh370/ocean/testing/found: recursive directory loop

grep: warning: ./svn/pages/dvorak/xhtml/mh370/testing/dvorak/ocean/sea: recursive directory loop

grep: warning: ./svn/pages/dvorak/xhtml/mh370/testing/dvorak/ocean/monday: recursive directory loop

grep: warning: ./svn/pages/dvorak/xhtml/mh370/testing/dvorak/monday: recursive directory loop

grep: warning: ./svn/pages/dvorak/xhtml/mh370/testing/ocean/dvorak/found: recursive directory loop

grep: warning: ./svn/pages/dvorak/xhtml/mh370/testing/ocean/dvorak/monday: recursive directory loop

grep: warning: ./svn/pages/dvorak/xhtml/mh370/testing/ocean/monday: recursive directory loop

grep: warning: ./svn/pages/gulf/xhtml/qwerty/ocean/dvorak/found: recursive directory loop

grep: warning: ./svn/pages/gulf/xhtml/qwerty/ocean/dvorak/testing/sea: recursive directory loop

grep: warning: ./svn/pages/gulf/xhtml/qwerty/ocean/dvorak/testing/found: recursive directory loop

grep: warning: ./svn/pages/gulf/xhtml/qwerty/ocean/testing/dvorak/found: recursive directory loop

grep: warning: ./svn/pages/gulf/xhtml/qwerty/ocean/testing/dvorak/monday: recursive directory loop

grep: warning: ./svn/pages/gulf/xhtml/qwerty/ocean/testing/found: recursive directory loop

grep: warning: ./svn/pages/gulf/xhtml/qwerty/dvorak/ocean/sea: recursive directory loop

grep: warning: ./svn/pages/gulf/xhtml/qwerty/dvorak/ocean/testing/sea: recursive directory loop

grep: warning: ./svn/pages/gulf/xhtml/qwerty/dvorak/ocean/testing/found: recursive directory loop

grep: warning: ./svn/pages/gulf/xhtml/qwerty/dvorak/testing/sea: recursive directory loop

grep: warning: ./svn/pages/gulf/xhtml/qwerty/dvorak/testing/ocean/sea: recursive directory loop

grep: warning: ./svn/pages/gulf/xhtml/qwerty/dvorak/testing/ocean/monday: recursive directory loop

grep: warning: ./svn/pages/india/xhtml/abcd/testing/dvorak/ocean/sea: recursive directory loop

grep: warning: ./svn/pages/india/xhtml/abcd/testing/dvorak/ocean/monday: recursive directory loop

grep: warning: ./svn/pages/india/xhtml/abcd/testing/dvorak/monday: recursive directory loop

grep: warning: ./svn/pages/india/xhtml/abcd/testing/ocean/dvorak/found: recursive directory loop

grep: warning: ./svn/pages/india/xhtml/abcd/testing/ocean/dvorak/monday: recursive directory loop

grep: warning: ./svn/pages/india/xhtml/abcd/testing/ocean/monday: recursive directory loop

grep: warning: ./svn/pages/india/xhtml/abcd/dvorak/ocean/sea: recursive directory loop

grep: warning: ./svn/pages/india/xhtml/abcd/dvorak/ocean/testing/sea: recursive directory loop

grep: warning: ./svn/pages/india/xhtml/abcd/dvorak/ocean/testing/found: recursive directory loop

grep: warning: ./svn/pages/india/xhtml/abcd/dvorak/testing/sea: recursive directory loop

grep: warning: ./svn/pages/india/xhtml/abcd/dvorak/testing/ocean/sea: recursive directory loop

grep: warning: ./svn/pages/india/xhtml/abcd/dvorak/testing/ocean/monday: recursive directory loop

这些消息是什么意思?

最佳答案

您必须从 grep 中排除符号链接(symbolic link),它们是此警告的原因。您应该首先尝试使用 find:

find ./ -type f -exec grep -il "blah_blah_text" {} \;

首次使用find时,可以在grep中省略-r,因为find已经是递归的了。

关于unix - grep:警告:递归目录循环,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22552538/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com