LoginSignup
1
1

More than 3 years have passed since last update.

Sublime Text で特定ファイルやディレクトリを除外して Grep 検索する

Posted at

Sublime Text で特定ファイルやディレクトリを除外して Grep 検索する時の書き方です。


Grep 検索画面を表示させる。

Command キー(⌘) + Shift キー(⇧) + F

Find : に、検索したい文字列を入力
Where :に、検索したいディレクトリを入力


例 1)
「書類」の「src」ディレクトリ内の文字列、「container」を検索

Find :

container

Where :

/Users/user-name/Documents/src/

例 2)

「書類」の「src」ディレクトリ内で、「sass」ディレクトリ以外の文字列、「container」を検索

Find :

container

Where :

/Users/user-name/Documents/src/, -*/sass/*

例 3)
「書類」の「src」ディレクトリ内で、「sass」ディレクトリ以外で、全ての「.css」ファイル以外からの文字列「container」を検索

Find :

container

Where :

/Users/user-name/Documents/src/, -*/sass/*, -*.css

さらに条件を付け加えたい場合は「,」区切りで追記する。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1