Subscribe to How-To Geek

A "live" view of a logfile on Linux

This approach works for any linux operating system, including Ubuntu, and is probably most often used in conjunction with web development work.

tail -f /path/thefile.log

This will give you a scrolling view of the logfile. As new lines are added to the end, they will show up in your console screen.

For Ruby on Rails, for instance, you can view the development logfile by running the command from your project directory:

tail -f log/development.log

As with all linux apps, Ctrl+C will stop it.

| More
This article was originally written on 09/11/06 Tagged with: Programming, Ruby, Ruby on Rails, SysAdmin, Ubuntu

Daily Email Updates

You can get our how-to articles in your inbox each day for free. Just enter your name and email below:


Name:
Email:

Comments (6)

  1. sven

    if your’re already in less and would like to trace the file:
    less /path/thefile.log
    Shift+F

    to stop_
    Ctrl+C
    q

  2. moe

    I’ve seen all of the tips you got for linux and dude it’s cool so i got something to help some new ubuntu users
    1.www.getdeb.net
    getdeb got some really cool programs all it takes is for you to find something you like and click download because it’s .deb file it’s easy to install, but what shuld you get,
    A.(Ubuntu Tweak) with this little easy to use you can do most of the things here on you’re website,
    for new ubuntu users who don’t know how to use the terminal and the config editor by useing ubuntu tweak you can add and remove things off the desk top like My Computer- Trash and alot more
    B.(Screenlets) even that screenlets come in ubuntu the version is older the one on getdeb is the latest it’s aloes is with all of there programs.
    C.( Avant Window Navigator) this nice thing here is a dock that apple can never beat, just like screenlets the version is old and by ading getdeb to you’re source list you can get applets that beat all of the other docks .
    2.(Flock) is an amazing web browser it’s just like firefox but you can do mutch more and it’s so easy to use. (i’m using it right now)
    3.(Alien Arena) i cant give a tip with no games that’s just wrong, alien arena is a cool 3d game it’s amazing
    4. if you’re to lazy to install of the things on getdeb.net here is a away to bring getdeb to you’re home for the next 500 years
    open your source list (system-administration-software source)
    a windows well open and but your password if it asked you for when the windows opens click on
    third-party software, on the bottom left corner click on +Add and add this source to it
    deb http://ubuntu.org.ua/ getdeb/
    now just click close and it will ask you to reload then open up the terminal in (Applications-accessories-terminal and type or past this
    sudo apt-get update && sudo apt-get upgrade
    now everything on getdeb.net that works on you’re ubuntu will be in synaptic package manger.

  3. blu

    moe please shut up!

    this: deb http://ubuntu.org.ua/ getdeb/
    doesn’t even exist ! please check your sources before telling us your crap. tkz

  4. Sharninder

    tail -f will work as long as the underlying file we’re trying to read doesn’t change. If you’re trying to read a link to a file and the original file (and thus the link) changes, tail -f will not work.

    For that reason, its better to use tail -F for such files as described above … or tail -f –retry

  5. lamapper

    for brand new users… the less command will help you look at log files that have been compressed (.gz).

    most logs are in /var/log/ unless otherwise specified in a configuration file somewhere. Logs you will want to check out include: auth.log; messages; syslog. Other interesting log files are user.log; kern.log; dmesg and daemon.log.

    cat messages
    cat syslog

    While the CAT command will work with those, it will not work with the files ending in the extension .gz

    For these rotated files, use less:

    less auth.log.1.gz (assuming it exists on your system.)
    less messages.1.qz
    less syslog.1.gz

    remember that GREP and AWK are powerful friends that you want to learn and will help you get exactly the information you need from any file on GNU/Linux. Remember GNU/Linux is all about files….and that is an understatement.

    last – a – shows you who logged in; when and when they logged out….

  6. christy

    how to configure mobile brodband on ubuntu 9.04 from scratch connects sometimes then fails to connect i think i am to use ppp0 but no sucsess


Leave a Comment




Leave your friendly comment here.

If you have a computer help question, click here to leave it on the forums instead.

Note: Your comment may not show up immediately on the site.

Our Friends
Getting Started


About How-To Geek
What Is That Process?
svchost.exe
jusched.exe
dwm.exe
ctfmon.exe
wmpnetwk.exe
wmpnscfg.exe
rundll32.exe
wfcrun32.exe
Ipoint.exe
Itype.exe
Wfica32.exe
Mobsync.exe
conhost.exe
Dpupdchk.exe Adobe_Updater.exe

Copyright © 2006-2009 HowToGeek.com. All Rights Reserved.