Subscribe to How-To Geek Підписатись на How-To Geek

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 "Живий" вид з лог-файл на Linux

This approach works for any linux operating system, including Ubuntu, and is probably most often used in conjunction with web development work. Такий підхід працює для будь-якої операційної системи Linux, включаючи Ubuntu, і, ймовірно, найбільш часто використовується в поєднанні з веб-розробок.

tail -f /path/thefile.log Хвіст-F / шлях / 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: Для Ruby On Rails, наприклад, ви можете переглядати лог розвитку, виконавши команду з вашого проекту:

tail -f log/development.log Хвіст-F журналу / development.log

As with all linux apps, Ctrl+C will stop it. Як і у всіх додатках Linux, Ctrl + C не зупинить його.

This article was originally written on 09/11/06 Tagged with: Ця стаття була спочатку написана на 09/11/06 тегами: Programming Програмування , , Ruby Ruby , , Ruby on Rails Ruby On Rails , , SysAdmin Системний адміністратор , , Ubuntu Ubuntu

Daily Email Updates Email Щоденні оновлення

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) Коментарі (6)

  1. sven Sven

    if your're already in less and would like to trace the file: якщо Your're вже менше, і хотів би простежити файлу:
    less /path/thefile.log менш / шлях / thefile.log
    Shift+F Shift + F

    to stop_ до stop_
    Ctrl+C Ctrl + C
    q 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 Я бачив всі поради ви отримали для Linux і чувак це круто так що я отримав те, щоб допомогти новим користувачам Ubuntu
    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 отримали деякі дійсно прохолодно програмах все, що потрібно для Вас, щоб знайти щось вам подобається, і натисніть кнопку "Завантаження тому що. Деб файлу можна легко встановити, але те, що ви отримаєте shuld,
    A.(Ubuntu Tweak) with this little easy to use you can do most of the things here on you're website, A. (Ubuntu Tweak) з цим мало простий у використанні ви можете зробити більшість речей, тут ви веб-сайту,
    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 Ubuntu для нових користувачів, які не знають, як використовувати термінал і конфігурації за допомогою редактора Ubuntu Tweak Ви можете додавати і видаляти речей від настільних, як Мій Комп'ютер-Trash і багато іншого
    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) навіть, що Screenlets прийти в Ubuntu версії старше одного на Getdeb є останнім його алое це з усіма там програми.
    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), це приємно тут полягає в доці, що Apple ніколи не може бити, як Screenlets версії старої і ading Getdeb щоб ви вихідного списку ви можете отримати аплетів, які б'ють всі інші доки.
    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) являє собою дивовижний браузер це як Firefox, але ви можете зробити Матч більше і він настільки простий у використанні. (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 3. (Alien Arena) Я нахиляє давати чайові, НЕ гра, що просто так, Alien Arena є COOL 3D гри це дивно
    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 Якщо ви ліниві, щоб встановити речей на getdeb.net тут геть довести Getdeb щоб ви додому на наступні 500 років
    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 Windows і відкритими, але і пароль, якщо він запитав вас, коли вікно відкривається по кнопці
    third-party software, on the bottom left corner click on +Add and add this source to it програмне забезпечення сторонніх виробників, у нижньому лівому куті натисніть на + Додати і додайте до неї джерело
    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 Тепер просто натисніть кнопку Закрити і він запропонує вам перезавантажити потім відкрити термінал (Applications-аксесуари-терміналу і введіть або це минуле
    sudo apt-get update && sudo apt-get upgrade Sudo APT-отримати оновлену & & Sudo APT-отримати оновлення
    now everything on getdeb.net that works on you're ubuntu will be in synaptic package manger. Зараз все на getdeb.net, яка працює на ви Ubuntu буде в синаптичну вересня пакет.

  3. blu Blu

    moe please shut up! МНС будь ласка, заткнись!

    this: deb наступним чином: Деб http://ubuntu.org.ua/ http://ubuntu.org.ua/ getdeb/ Getdeb /
    doesn't even exist ! навіть не існує! please check your sources before telling us your crap. Перевірте свої джерела Перш ніж розповісти нам ваші лайно. tkz ТКЗ

  4. Sharninder Sharninder

    tail -f will work as long as the underlying file we're trying to read doesn't change. Хвіст-F буде працювати стільки, скільки основного файлу ми намагаємося читати не зміниться. 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. Якщо ви намагаєтеся прочитати посилання на файл, а оригінальний файл (і тим самим Link) зміни, хвіст-F не буде працювати.

    For that reason, its better to use tail -F for such files as described above … or tail -f –retry З цієї причини, її краще використовувати хвостом-F для таких файлів, як описано вище ... або хвіст-F-повторів

  5. lamapper 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. Найбільш журнали знаходяться в / VAR / вхід / якщо інше не вказано у файлі конфігурації, де-то. Logs you will want to check out include: auth.log; messages; syslog. Логи вам потрібно буде перевірити включають: auth.log; повідомлень; Syslog. Other interesting log files are user.log; kern.log; dmesg and daemon.log. Інші цікаві файли журналів user.log; kern.log; Dmesg і daemon.log.

    cat messages Cat повідомленнях
    cat syslog 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.) менше auth.log.1.gz (якщо він існує у вашій системі.)
    less messages.1.qz менше messages.1.qz
    less syslog.1.gz менше 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. Пам'ятайте, що GREP і AWK є потужними друзям, що ви хочете дізнатися, і допоможе вам отримати саме ту інформацію, вам потрібно від будь-якого файлу на GNU / Linux. Remember GNU/Linux is all about files….and that is an understatement. Пам'ятайте GNU / Linux все про файли .... І це м'яко сказано.

    last – a – shows you who logged in; when and when they logged out…. Останній - A - показує вам, які увійшли в систему, коли і коли вони вийшли з ....

  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 Як налаштувати мобільний brodband на Ubuntu 9.04 з нуля з'єднується іноді виходить з ладу, щоб з'єднатися Я думаю, що я використовувати ppp0 але не sucsess


Our Friends Наші друзі
Getting Started Приступаючи до роботи


About How-To Geek Про How-To Geek
What Is That Process? Що це за процес?
svchost.exe svchost.exe
jusched.exe jusched.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. Всі права захищені.