Shell 如何批量打开具有特定名称的所有文件?
是否有一种方法可以使用命令行搜索所有具有文件夹(无限深度)的子文件夹,以查找并自动打开每个名为Shell 如何批量打开具有特定名称的所有文件?,shell,command-line,command,Shell,Command Line,Command,是否有一种方法可以使用命令行搜索所有具有文件夹(无限深度)的子文件夹,以查找并自动打开每个名为footer.php的文件 我能跑了 find /desktop/themes -name footer.php 它找到了所有的文件,但我不知道如何让它自动打开所有的文件。有人知道怎么做吗 (我正在cygwin中运行这个,以防有帮助。)尝试使用gvim-p。将打开不同选项卡中的所有文件: find /desktop/themes -name footer.php -print0 | xargs -0
footer.php的文件
我能跑了
find /desktop/themes -name footer.php
它找到了所有的文件,但我不知道如何让它自动打开所有的文件。有人知道怎么做吗
(我正在cygwin中运行这个,以防有帮助。)尝试使用gvim-p
。将打开不同选项卡中的所有文件:
find /desktop/themes -name footer.php -print0 | xargs -0 gvim -p
注意使用-print0
和xargs-0
安全解析find
的输出。应该使用默认程序打开它们,在这种情况下,默认程序是NotePad++。答案取决于如何从命令行在默认程序中打开单个文件。在MacOSX上,这将是openfooter.php
,因此您可以使用find$dir-name footer.php-exec open'{}\代码>;我不知道cygwin
中的open
的等价物。