LoginSignup
1
0

More than 5 years have passed since last update.

.git ディレクトリを除外して find を行えるようにする関数

Last updated at Posted at 2012-03-16

Git管理してるディレクトリで find を実行すると .git の中身も表示してしまってイラッとくるので

.zshrc
function git-find() {
   find $1 \( -type d -name '.git' -prune \) -or \( $*[2,-1] -print \)
}

function git-find0() {
   find $1 \( -type d -name '.git' -prune \) -or \( $*[2,-1] -print0 \)
}

もっとスマートな方法があるような気もする……

1
0
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
0