I will introduce how to follow and display the log that is always added
shell
$ tail -f ${logfile}
shell
$ less ${logfile}
After opening the file, type F
(uppercase F)
/ $ {search word}
to highlight a specific stringPress 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