對於我來說,在greg中使用-l標誌來獲取文件列表非常常見。我喜歡有辦法立即打開所有找到的文件(使用subl命令,我假設),而不是僅輸出一個列表。Mac:在grep中打開grep中找到的文件
我目前的工作流程:
grep --include=*.php -R -l "tribe_events_event_classes" .
,輸出:
./plugins/events-calendar-pro/views/day/loop.php
./plugins/events-calendar-pro/views/map/loop.php
./plugins/events-calendar-pro/views/photo/loop.php
./plugins/events-calendar-pro/views/widgets/mini-calendar/list.php
./plugins/the-events-calendar/lib/tribe-template-factory.class.php
./plugins/the-events-calendar/public/template-tags/general.php
./plugins/the-events-calendar/views/list/loop.php
./plugins/the-events-calendar/views/month/single-event.php
./themes/roots/tribe-events/day/loop.php
然後我通常通過一個與複製並粘貼文件中的一個:
subl ./plugins/events-calendar-pro/views/day/loop.php
subl ./plugins/events-calendar-pro/views/map/loop.php
etc...
我知道這裏有做一個更有效的方法。
我做相反的。我從崇高運行搜索。我在當前文件夾(subl。)中打開ST2,然後右鍵單擊樹窗格上的目錄並選擇Find%Replace。你可以給ST2一個文件掩碼查找逗號分隔。 –