I've been thoroughly confused for quite some time with ls
just plain refusing to work in some places, even though I have read permissions. After messing around a bit, it turns out that ls
works fine, as long as I run it with --color=never
, but as soon as I use auto
or always
, I get the familiar Permission denied
error on everything where I lack execution permissions.
What causes this and how can I stop it while keeping my ls
output in color?
Update: Okay, finally figured it out (as usual, directly after asking for help). You need execute permissions to enter directories, so cd and ls --color doesn't work on directories without it. I have no idea why I can still ls --color=never on directories without it though. Curious why that is?
ls
on a directory which you do not have execution permission on it?ls
command on, and then show us the output of your command.