LoginSignup
6
6

More than 5 years have passed since last update.

grepする時に特定のディレクトリを除外する

Posted at

grepする時に、カレントディレクトリ配下全てを検索とかすると、隠しディレクトリなど本当は検索したくないものも検索してしまって邪魔な時があります。

そんな時はgrepの--exclude-dirオプションを使えばOKです。

使い方

grep -rn hoge --exclude-dir=.git ./*

6
6
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
6
6