7

i'm getting a permission denied for a user in a really long path.

$ sudo sudo -u user cat /l/o/n/g/path/file
Permission denied

i'm pretty sure path and file have permissions for that user. Is there any easy way to find which of the other directories in /l/o/n/g does not?

gcb
  • 4,764
  • 11
  • 53
  • 73

2 Answers2

3

This will redirect the standard output of find to /dev/null, and display only the errors (including permission denied) while accessing directories.

find . -type d > /dev/null
slhck
  • 223,558
  • 70
  • 607
  • 592
MikeF
  • 61
  • 1
3

If you're okay with limiting the check to user/group/other permissions, use

namei -l /l/o/n/g/path/file
u1686_grawity
  • 426,297
  • 64
  • 894
  • 966