How to see log to find a boot problem

I want to find the cause of a boot problem I have tried ls -ltr /var/log from antony@antony which gives me login incorrect can someone tell me what command to use to see what has upset the boot thanks

NB when trying some commands from antony@antony then password I get login incorrect. Is that right?


Solution 1:

For systemd based versions of Ubuntu (15.04 onwards) you'll need to use the journalctl command to view the current boot log messages (as mentioned in this answer, and here for more info on how to enable them for previous boots):

journalctl -b

Solution 2:

You can use two log files to view the boot problem.

/var/log/boot.log  ---  System boot log

/var/log/dmesg     ---  print or control the kernel ring buffer

Solution 3:

To view kernel messages...

dmesg

or to page through the messages...

dmesg | less

The program helps users to print out their kernel messages. Instead of copying the messages by hand, the user only needs to enter at the console: $ dmesg > kernel.messages and mail the kernel.messages file to whoever can debug their problem.