Thursday, February 19, 2015

leveling up with tail -f: linux live view of error logs

I've been using 'cat' every time I wanted to look at a log view --which was often when I was in the middle of debugging.

You don't have to do that.

http://www.howtogeek.com/howto/ubuntu/a-live-view-of-a-logfile-on-linux/

 instead, just use

tail -f /path/to/thelogfile.log , 


which gives you a live view of your log file.

===============
edit: I've been using this for awhile now and just today I was having issues with wanting to search through the log without leaving the tail -f call.  The solution to that is listed here:

http://www.brianstorti.com/stop-using-tail/

Basically, you can use the same "follow" capability in Unix "less" if you only need to follow one file.

less +F /path/to/thelogfile.log

The cool thing here is that you can use vi navigation and search commands to get around quickly.

Also, it's fairly common that I've been using vim to look at files that I don't want to alter.  It might make more sense to just start out with less.

No comments:

Post a Comment