Ami*_*and 1 recursion search solaris file
寻找solaris命令获取包含搜索模式的所有文件的列表(递归).我知道如何为linux做这个,但同样的命令在solaris中不起作用:
bash-3.2# uname -a
SunOS D1NCIC-CL01 5.10 Generic_148888-03 sun4u sparc SUNW,Sun-Fire-15000
bash-3.2# find . -type f -print0 | xargs -0 grep -l "contentInFile"
xargs: illegal option -- 0
xargs: Usage: xargs: [-t] [-p] [-e[eofstr]] [-E eofstr] [-I replstr] [-i[replstr]] [-L #] [-l[#]] [-n # [-x]] [-s size] [cmd [args ...]]
find: bad option -print0
find: [-H | -L] path-list predicate-list
Run Code Online (Sandbox Code Playgroud)
结合使用的情况经常如此find,xargs这里没用.您可以在Solaris和Linux上运行此可移植命令以获得所需内容:
find . -type f -exec grep -l "contentInFile" {} +
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
16269 次 |
| 最近记录: |