How can I view live logs on a Linux server (Ubuntu)

4

1

How can I view a live log on a Linux server, so that I can see new log entries instantly as they are being added?

wowpatrick

Posted 2011-07-29T10:29:35.273

Reputation: 3 039

Answers

8

Over the Terminal

In the most simple case:

tail -f /var/log/name-of-logfile-you-want-to-watch

The -f option "follows" the file and will automatically update the view as the file is being updated. For a list of possible log files, you can see this article or just explore them yourself.


Using a GUI log viewer

If you have GNOME as a graphical environment installed, it comes with a log viewer called gnome-system-log. Open it with:

gnome-system-log &

You will find a manual here.

slhck

Posted 2011-07-29T10:29:35.273

Reputation: 182 472

If there are any other requirements (your question wasn't that specific), just report back. – slhck – 2011-07-29T10:37:27.580

Great answer, thanks. Just one more question, what dose the trail function actually do? – wowpatrick – 2011-07-29T11:50:31.930

tail not trail. tail prints the "tail" of given file :). By default last 10 lines. – Beniamin – 2011-07-29T13:03:06.283

2

You can also use less if you're interested in that interface rather than tail.

less /var/log/syslog

and then press Shift-F to scroll to the bottom. Less will watch for more text.

demize

Posted 2011-07-29T10:29:35.273

Reputation: 173

Press / to search for words – Gaurav Kumar – 2014-03-20T20:06:18.170