Skip to main content
replaced http://unix.stackexchange.com/ with https://unix.stackexchange.com/
Source Link

Try the following solution (should be Linux, Unix and OS X compatible):

find . -type d -execdir sh -c 'test -z "$(find "{}" -mindepth 1 -type d)" && echo $PWD/{}' ';'

It's similar approach to rush solutionrush solution, but without any pipes.

Try the following solution (should be Linux, Unix and OS X compatible):

find . -type d -execdir sh -c 'test -z "$(find "{}" -mindepth 1 -type d)" && echo $PWD/{}' ';'

It's similar approach to rush solution, but without any pipes.

Try the following solution (should be Linux, Unix and OS X compatible):

find . -type d -execdir sh -c 'test -z "$(find "{}" -mindepth 1 -type d)" && echo $PWD/{}' ';'

It's similar approach to rush solution, but without any pipes.

Source Link
kenorb
  • 22.1k
  • 18
  • 149
  • 172

Try the following solution (should be Linux, Unix and OS X compatible):

find . -type d -execdir sh -c 'test -z "$(find "{}" -mindepth 1 -type d)" && echo $PWD/{}' ';'

It's similar approach to rush solution, but without any pipes.