/var/log/messages permissions issue...

T.C. Hollingsworth tchollingsworth at gmail.com
Mon Mar 19 03:24:39 UTC 2012


On Sun, Mar 18, 2012 at 8:18 PM, Rob Healey <robhealey1 at gmail.com> wrote:
> Greetings:
>
> I was trying to look at the system messages this evening, and this is what I
> got...
>
> [root at BurningBushes ~]# grep shell | /var/log/messages
> -bash: /var/log/messages: Permission denied

You were attempting to pipe the output of `grep shell` to a program
called `/var/log/messages`.  '/var/log/messages' is not executable, so
bash fails with that permission denied error.  Since you're missing
the third argument to `grep`, it waits for input from stdin to search,
which is why you had to CTRL+C to get back to the shell.

Drop the pipe symbol so the command reads `grep shell
/var/log/messages` and you'll instead search /var/log/messages for
"shell".  ;-)

> It didn't display anything on my terminal window, and I had to do a
> [Control] C to get out of it...

-T.C.


More information about the test mailing list