spl*_*ter 3 linux filesystems recursion command-line find
我需要在当前文件夹(非递归)和其他一些文件夹(递归)中查找文件。例如我有一个树结构,如下所示:
我只想找到文件file1.php,file2.php并且file2-1.php仅此而已。因此,递归地在 root +folder2/ 中搜索。
我能找到的所有资源都描述了
find . -maxdepth 1 -iname "*.php" // gives `file1.php` and `file2.php`
Run Code Online (Sandbox Code Playgroud)
或者
find folder2 -iname "*.php" // gives me `file2-1.php`
Run Code Online (Sandbox Code Playgroud)
所以:
问:如何组合这些命令?
PS 我应该能够在命令行中进一步发送找到的文件列表(例如发送到 xgettext)。
像这样?
( find . -maxdepth 1 -iname "*.php"; find folder2 -iname "*.php") | xgettext
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3681 次 |
| 最近记录: |