LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Dumping /var/log./messages using 'cat' is failing (http://www.linuxquestions.org/questions/linux-newbie-8/dumping-var-log-messages-using-cat-is-failing-844366/)

greplinux 11-15-2010 09:29 AM

Dumping /var/log./messages using 'cat' is failing
 
Hi,

I am trying to dump /var/log/messages using cat command, but it is failing.
Quote:

Command:
[root@greplinux-linux ~]# cat /var/log/messages

Op:
cat: /var/log/messages: Invalid argument

messages file is present in /var/log. When I tried to open that using 'vi' it is saying 'messages' is not a file.

First column of command "ls -l /var/log/messages" is '?rwsrwsrwt'.

What is that I am doing wrong? Please guide me.

Thanks in advance

stress_junkie 11-15-2010 09:51 AM

This is my messages file.
Code:

$ ls -l /var/log/messages
-rw-r----- 1 syslog adm 1543 2010-11-15 08:37 /var/log/messages

Looks like something messed up your file. Maybe you should fsck the disk.

werewolfy 11-16-2010 12:48 PM

Hm... seems like the file mode bits are messed up (rwsrwsrwt means that every possible bit is set there).

try

chmod 644 /var/log/messages

and look if this changes them back to
rw-r--r--

The "?" in front of the mode doesn't look good either... did you check your disk like 'stress_junkie' already proposed?

Any other files in /var/log or elsewhere with the same symptoms?


All times are GMT -5. The time now is 05:08 AM.