Skip to main content
Including example output.
Source Link
Christopher Karel
  • 6.7k
  • 1
  • 30
  • 35

Use the -prune flag.

find /var/wwwhosts/ -type -d -perm 777 -prune should show exactly what you want.

Edit: Here's what this is doing for me, I believe this is what you wanted?

# ls -l
drwxrwxrwx 4 root root 4096 Feb 25 14:21 c

# ls -l c
drwxr-xr-x 2 root root 4096 Feb 25 14:21 1
drwxrwxrwx 2 root root 4096 Feb 25 14:21 2

# find . -perm 777 -prune
./c

# find . -perm 777 -prune -exec ls -ld {} \;
drwxrwxrwx 4 root root 4096 Feb 25 14:21 ./c

Use the -prune flag.

find /var/wwwhosts/ -type -d -perm 777 -prune should show exactly what you want.

Use the -prune flag.

find /var/wwwhosts/ -type -d -perm 777 -prune should show exactly what you want.

Edit: Here's what this is doing for me, I believe this is what you wanted?

# ls -l
drwxrwxrwx 4 root root 4096 Feb 25 14:21 c

# ls -l c
drwxr-xr-x 2 root root 4096 Feb 25 14:21 1
drwxrwxrwx 2 root root 4096 Feb 25 14:21 2

# find . -perm 777 -prune
./c

# find . -perm 777 -prune -exec ls -ld {} \;
drwxrwxrwx 4 root root 4096 Feb 25 14:21 ./c
Source Link
Christopher Karel
  • 6.7k
  • 1
  • 30
  • 35

Use the -prune flag.

find /var/wwwhosts/ -type -d -perm 777 -prune should show exactly what you want.