This question already has an answer here:
I am an a redhat box and I noticed that if I accidentally type in a dir path without cd in front of it, I get a /path/to/dir/: Permission denied.; however, I would expect it to say /path/to/dir/: Command not found. Just as if I typed in nonsense like:
$ sldkfjsd
sldkfjsd: Command not found.
What purpose does this have and what would happen if I was to run a dir as a command as a super user (I don't have sudo access)?