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

Where are the linux system logs?

藏色散人
藏色散人Original
2019-02-28 11:16:168415browse

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

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 

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 

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

tail -n 

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!

Statement:
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