0

How do I run a find command to find php files but I exclude a folder i.e. /usr/local/bin?

user9517
  • 115,471
  • 20
  • 215
  • 297
edotan
  • 1,876
  • 13
  • 39
  • 57

2 Answers2

2

Prune it.

find some/dir \( -type d -path some/dir/some/other/dir -prune -o -name '*.php' -print \)
Ignacio Vazquez-Abrams
  • 45,939
  • 6
  • 79
  • 84
0

You can use the find command in linux to do this. Something like this should work.

find / \! -path "/usr/local/bin/*" -name "*.php"
barryj
  • 978
  • 1
  • 5
  • 8