LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Veiwing log files (https://www.linuxquestions.org/questions/linux-newbie-8/veiwing-log-files-725168/)

just a man 05-11-2009 06:33 AM

Veiwing log files
 
Hi all.

I'm trying to review log files, to see who previously accessed my server, and what commands were run. However when I try using nano, cat or vi to read /var/log/wtmp, just gobbledegook comes up.

I'm not actually expecting to find anything suspicious I just want to know how to do it, so I have tried to read this file on a Ubuntu machine as well as a Gentoo one, but the same problem happens for both, I can't read dmesg either. Are these files only available using a command or can I just veiw them as text files using nano for instance?

acid_kewpie 05-11-2009 06:42 AM

it's a binary file read by "last".

just a man 05-11-2009 07:41 AM

Hm,

Quote:

$ last /var/log/wtmp

wtmp begins Fri May 1 15:46:25 2009
:newbie:

just a man 05-11-2009 08:04 AM

Is there a way to see a chronological list of previous logins instead of just the last one?

colucix 05-11-2009 08:23 AM

Use the last command alone (you have not to give the wtmp file as argument, since last will read it automatically):
Code:

last

just a man 05-11-2009 08:32 AM

Vielen Dank.:)


All times are GMT -5. The time now is 04:40 PM.