我正在尝试在目录中查找一些文件。默认情况下,查找command正在搜索我指定的目录及其子目录。
我尝试使用depth/maxdepthand prune,但没有任何帮助来克服这个问题。有人可以指出在 Solaris 中使用深度/修剪的正确方法吗?
我的代码如下所示:
find file_path -depth 1 -name '*.log'
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
find: bad option 1
find: [-H | -L] path-list predicate-list
Run Code Online (Sandbox Code Playgroud) 可能重复:
使用 find 时 Arg 列表太长错误
我尝试在具有特定内容的许多文件夹中找到许多文件,然后将其删除。
find dir.*/* -exec grep -l "content" {} \; | xargs rm -f
Run Code Online (Sandbox Code Playgroud)
我收到以下消息:
-bash: /bin/find: Argument list too long
Run Code Online (Sandbox Code Playgroud)
你能帮助我吗?