How to view the linux system log
Editor to share with you how to view the linux system log, I hope you will learn a lot after reading this article, let's discuss it together!
Linux Syslog files provide event schedules for Linux operating systems, applications, and services. These files are stored in plain text for easy reading.
So where can I find the Linux log file?
Linux log files are usually stored in the / var/log folder
This folder will contain a large number of files, and you can get information about each application.
For example, when the ls command runs in the sample / var/log folder, there are some logs available.
Kern.logauth.logbootstrap.logalternatives.logsambacupslightdm
The last three in the list are folders, and they all have log files in the folder.
Because the log files are in plain text format, you can enter the following command to read them:
Nano
The above command opens the log file in an editor called nano. It is OK to open the log file in the editor if the log file is small, but if the log file is large, you may only be interested in reading the end of the log.
The tail command allows you to read the last few lines in the file as follows:
Tail
You can use the-n switch to specify the number of rows to display, as follows:
Tail-n finished reading this article, I believe you have a certain understanding of how to view the linux system log, want to know more related knowledge, welcome to follow the industry information channel, thank you for reading!