Important! This is an automatic machine translated page. If you can read english, you should Click Here to read the original English version of the article.

A "live" view of a logfile on Linux En "live" inför en loggfil på Linux

This approach works for any linux operating system, including Ubuntu, and is probably most often used in conjunction with web development work. Denna metod fungerar för alla Linux-operativsystem, inklusive Ubuntu, och är förmodligen oftast används i samband med webbutveckling arbete.

tail -f /path/thefile.log tail-f / path / thefile.log

This will give you a scrolling view of the logfile. Detta kommer att ge dig en bläddring bakgrund av loggfil. As new lines are added to the end, they will show up in your console screen. Eftersom nya rader läggs till slut kommer de upp i din konsol skärm.

For Ruby on Rails, for instance, you can view the development logfile by running the command from your project directory: För Ruby on Rails, till exempel, kan du visa utvecklingen loggfil genom att köra kommandot från projektet katalogen:

tail -f log/development.log tail-f log / development.log

As with all linux apps, Ctrl+C will stop it. Som med alla linux apps, Ctrl + C kommer att stoppa det.

This article was originally written on 09/11/06 Tagged with: Denna artikel skrevs ursprungligen på 09/11/06 Märkta med: Programming Programmering , , Ruby Ruby , , Ruby on Rails Ruby on Rails , , SysAdmin Sysadmin , , Ubuntu Ubuntu

Daily Email Updates Dagligt Updates

You can get our how-to articles in your inbox each day for free. Du kan få våra instruktioner artiklar i din inkorg varje dag gratis. Just enter your name and email below: Skriv bara in ditt namn och e-postadress nedan:


Name: Namn:
Email: Email:

Comments (6) Kommentarer (6)

  1. sven sven

    if your're already in less and would like to trace the file: Om your're redan i mindre och skulle vilja spåra filen:
    less /path/thefile.log mindre / path / thefile.log
    Shift+F Skift + F

    to stop_ till stop_
    Ctrl+C Ctrl + C
    q q

  2. moe 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 Jag har sett alla de tips du fick för Linux och dude it's cool så jag har något att hjälpa några nya ubuntu användare
    1.www.getdeb.net 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, getdeb fick några riktigt coola program Allt som krävs är att du hittar något du gillar och klicka på ladda ner för att det är. deb-filen är det enkelt att installera, men vad shuld du får,
    A.(Ubuntu Tweak) with this little easy to use you can do most of the things here on you're website, A. (Ubuntu Tweak) med denna lilla enkla att använda kan du göra de flesta saker här om du hemsida,
    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 för nya ubuntu användare som inte vet hur man använder terminalen och config editor genom att använda Ubuntu Tweak du kan lägga till och ta bort saker på skrivbordet som My Computer-Trash och mycket mer
    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. B. (screenlets) även att screenlets komma i Ubuntu versionen är äldre den på getdeb är det senaste it's aloe är med alla där program.
    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 . C. (Avant Window Navigator) denna fina sak här är en docka som äpple aldrig kan slå, precis som screenlets versionen är gammal och ading getdeb att du är källan som du kan få applets att slå alla de andra dockorna.
    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. 2. (Flock) är en fantastisk webbläsare Det är precis som Firefox, men du kan göra mutch mer och det är så lätt att använda. (i'm using it right now) (Jag använder det just nu)
    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 3. (Alien Arena) i cant ge ett tips med några spel som bara fel, är främmande arena en cool 3d spel It's amazing
    4. 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 Om du till lat för att installera av de saker getdeb.net här är en borta att få getdeb att du är hem för de kommande 500 åren
    open your source list (system-administration-software source) open källistan (system-administration-källkod)
    a windows well open and but your password if it asked you for when the windows opens click on ett fönster öppna och väl men ditt lösenord om det bad dig om när fönstren öppnas klicka på
    third-party software, on the bottom left corner click on +Add and add this source to it program från tredje part, på det nedre vänstra hörnet klicka på + Lägg till och lägg till denna källa till det
    deb deb http://ubuntu.org.ua/ http://ubuntu.org.ua/ getdeb/ 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 nu bara på Stäng och det kommer att be dig att ladda sedan öppna terminal (Program-tillbehör-terminal och skriv eller förbi detta
    sudo apt-get update && sudo apt-get upgrade 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. Nu är allt på getdeb.net som fungerar om du Ubuntu kommer vara i Pakethanteraren krubban.

  3. blu blu

    moe please shut up! moe please shut up!

    this: deb detta: deb http://ubuntu.org.ua/ http://ubuntu.org.ua/ getdeb/ getdeb /
    doesn't even exist ! inte ens existerar! please check your sources before telling us your crap. Vänligen kontrollera era källor innan du berättat din skit. tkz TKZ

  4. Sharninder Sharninder

    tail -f will work as long as the underlying file we're trying to read doesn't change. tail-f kommer att arbeta så länge som den underliggande filen vi försöker läsa ändras inte. 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. Om du försöker läsa en länk till en fil och den ursprungliga filen (och därmed länken) ändringarna tail-f kommer inte att fungera.

    For that reason, its better to use tail -F for such files as described above … or tail -f –retry Av den anledningen, det är bättre att använda svans-F för sådana akter som beskrivs ovan ... eller tail-f-retry

  5. lamapper lamapper

    for brand new users… the less command will help you look at log files that have been compressed (.gz). för helt nya användare ... mindre kommandot hjälper dig att titta på loggfiler som har komprimerats (. gz).

    most logs are in /var/log/ unless otherwise specified in a configuration file somewhere. flesta loggarna i / var / log / om inte annat anges i en konfigurationsfil någonstans. Logs you will want to check out include: auth.log; messages; syslog. Loggar du kommer att vilja kolla in är: auth.log; meddelanden; syslog. Other interesting log files are user.log; kern.log; dmesg and daemon.log. Andra intressanta loggfiler user.log, kern.log, dmesg och daemon.log.

    cat messages cat meddelanden
    cat syslog cat syslog

    While the CAT command will work with those, it will not work with the files ending in the extension .gz Medan CAT kommandot kommer att arbeta med dem, kommer det fungerar inte med filer som slutar i förlängningen. Gz

    For these rotated files, use less: För dessa roteras filer, använda mindre:

    less auth.log.1.gz (assuming it exists on your system.) mindre auth.log.1.gz (om den finns på ditt system.)
    less messages.1.qz mindre messages.1.qz
    less syslog.1.gz mindre 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. Kom ihåg att GREP och AWK är mäktiga vänner som du vill lära dig och hjälper dig att få exakt den information du behöver från alla filer på GNU / Linux. Remember GNU/Linux is all about files….and that is an understatement. Kom ihåg GNU / Linux handlar om filer .... Och det är en underdrift.

    last – a – shows you who logged in; when and when they logged out…. sista - en - visar dig som loggat in, när och när de loggade ut ....

  6. christy 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 konfigurerar mobil brodband om Ubuntu 9.04 från scratch kopplar ibland då inte ansluta Jag tror att jag använder ppp0 men sucsess


Leave a Comment Lämna en kommentar




Leave your Lämna ditt friendly friendly comment here. kommentar här.

If you have a computer help question, Om du har en dator hjälp fråga, click here to leave it on the forums Klicka här för att lämna det i forumen instead. istället.

Note: Your comment may not show up immediately on the site. Obs: Din kommentar inte får visa upp omedelbart på platsen.

Our Friends Our Friends
Getting Started Komma igång


About How-To Geek Om How-To Geek
What Is That Process? Hur skall den processen?
svchost.exe svchost.exe
jusched.exe SynTPEnh.exe
dwm.exe dwm.exe
ctfmon.exe CTFMON.EXE
wmpnetwk.exe wmpnetwk.exe
wmpnscfg.exe wmpnscfg.exe
rundll32.exe rundll32.exe
wfcrun32.exe wfcrun32.exe
Ipoint.exe Ipoint.exe
Itype.exe Itype.exe
Wfica32.exe Wfica32.exe
Mobsync.exe Mobsync.exe
conhost.exe conhost.exe
Dpupdchk.exe Dpupdchk.exe Adobe_Updater.exe Adobe_Updater.exe

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