Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to view the linux system log

Shulou Source: shulou.com Published: 2022-06-02 01:42:32 10月30日 Update

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!

Tags: Files logs folders systems commands applications text programs articles editors storage applications large operating systems three events information interests finished form Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Redmi Apple Xiaomi MySQL