LoginSignup
66

More than 5 years have passed since last update.

posted at

updated at

findで特定のディレクトリを除外

特定のディレクトリ(lib)を除外したファイルの一覧を取得

例1
$ find . -type d -name lib -prune -o -type f -print

特定のディレクトリ(lib)を除外して、ファイル名が"*.php"のものの一覧を取得

例2
$ find . -type d -name lib -prune -o -type f -name '*.php' -print

参考: findコマンドで特定のディレクトリ以下を無視する方法 - mollifier delta blog

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
What you can do with signing up
66