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
  • 5,442
  • 13
  • 62
  • 86

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
  • 235,242
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
grawity
  • 501,077