Skip to main content

Assuming your find supports it, use the -execdir option instead of -exec

find . -name 'foo' -execdir pwd \; 
Chris Davies
  • 128.5k
  • 16
  • 179
  • 325