Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 2 down vote accepted

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
share|improve this answer
nice! find l/ -type d > /dev/null find: l/o/n: Permission denied – gcb Oct 22 '13 at 0:18

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

namei -l /l/o/n/g/path/file
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.