[Linux] How to monitor logs that are constantly added

I will introduce how to follow and display the log that is always added

tail command

shell


$ tail -f ${logfile}

Use less forever option

shell


$ less ${logfile}

After opening the file, type F (uppercase F)

Press Ctrl + C to stop viewing the log. If you just want to display the log, you should use tail, and if you want to see it in detail, you should use less etc.

Please note that if the file is replaced by logrotate etc., the monitoring will stop even if the replaced file name is the same as the original. If it is replaced, you need to exit the command and then reopen it.

Recommended Posts

[Linux] How to monitor logs that are constantly added
How to install wkhtmltopdf (Amazon Linux2)
How to install VMware-Tools on Linux
How to smartly define objects that are commonly used in View
How to install MBDyn (Linux Ubuntu)
[Python] How to use list 3 Added
How to check Linux OS version
[Windows] Transfer event logs to Linux
How to scrape pages that are “Access Denied” in Selenium + Headless Chrome
[Linux] How to subdivide files and folders
How to install aws-session-manager-plugin on Manajro Linux
How to crawl pages that scroll infinitely
[Linux] How to use the echo command
How to use the Linux grep command
How to update php on Amazon linux 2
How to display emoji on Manjaro Linux
How to install packages on Alpine Linux
How to install Anisble on Amazon Linux 2
How to operate Linux from the console
How to power off Linux with Ultra96-V2
10 Python errors that are common to beginners
How to update security on CentOS Linux 8
How to install php7.4 on Linux (Ubuntu)
How to find large files on Linux
[Note] Terms that are difficult to remember
How to get started with laravel (Linux)
How to deal with the problem that Japanese characters are garbled when outputting logs using JSON log formatter
How to make an embedded Linux device driver (11)
How to make an embedded Linux device driver (8)
How to make an embedded Linux device driver (4)
Python list comprehensions that are easy to forget
How to make an embedded Linux device driver (2)
How to make an embedded Linux device driver (3)
How to write regular expression patterns in Linux
How to operate Linux from the outside Procedure
Added firewalld to Amazon Linux 2 (IP address restrictions)
How to create a shortcut command for LINUX
How to switch between Linux and Mac shells
How to make an embedded Linux device driver (6)
How to install Camunda Modeler on Manjaro Linux
How to build Java environment on Ubuntu (Linux)
How to make an embedded Linux device driver (5)
How to make Linux compatible with Japanese keyboard
How to make an embedded Linux device driver (9)
[Python] How to compare datetime with timezone added
[Jinja2] Solution to the problem that variables added in the for statement are not inherited
How to create a USB that Linux and Win10 installer and winpe can boot UEFI
How to use a tp-link wireless LAN slave unit that does not support Linux
How to execute sleep command, command that takes time as a test [bash, linux, mac]