Home > Operation and Maintenance > Linux Operation and Maintenance > Where are the linux system logs?

Where are the linux system logs?

藏色散人
Release: 2019-06-05 15:06:51
Original
8636 people have browsed it

Linux system log files provide a timeline of events for the Linux operating system, applications, and services. These files are stored in plain text for easier reading.

Where are the linux system logs?

#So where can I find Linux log files?

Linux log files are usually stored in the /var/log folder

This folder will contain a large number of files that you can get for each application information.

For example, when the ls command is run in the sample /var/log folder, there are some logs available here.

kern.log
auth.log
bootstrap.log
alternatives.log
samba
cups
lightdm
Copy after login

The last three in the list are folders, and they all have log files within the folders.

Since log files are in plain text format, you can enter the following command to read them:

nano <logfilename>
Copy after login

The above command opens the log file in an editor called nano. If the log file is small then opening the log file in an editor is fine, but if the log file is large then you may only be interested in reading the end of the log.

The tail command allows you to read the last few lines in a file as follows:

tail <logfilename>
Copy after login

You can specify the number of lines to display using the -n switch as follows:

tail -n <logfilename>
Copy after login

Related recommendations: "Linux Tutorial"

This article is a relevant introduction to where the Linux system log is. I hope it will be helpful to friends in need!

The above is the detailed content of Where are the linux system logs?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template