Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

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.

Saturday, January 24, 2015

Unix Tree

You can get a nice directory tree that diagrams your file structure with the command "tree" (it's not installed on Ubuntu 14.04 ls by default--just sudo apt-get install tree.)  It's nice for communicating a layout quickly.

$tree