This is the third day of my participation in Gwen Challenge

Through the process of learning and sharing, I will summarize the problems and technologies in my work and output them. I hope that both the novice and the veteran can gain new knowledge through their own articles and put it into practice.

Commonly used instructions

View the logs of a specified service and scroll them in real time

View the latest etCD logs

journalctl -u etcd -f
Copy the code

The latest logs are displayed in real time

journalctl  -f
Copy the code

View logs of a specified service

journalctl -u etcd
Copy the code

Displays the last 20 lines of the log at the end

journalctl -n 20
Copy the code

other

View logs about the last startup

You need to change the Settings. For example, when you need to view the logs of the last system crash, you need to view the last startup logs.

journalctl -b -1
Copy the code

View logs at a specified time

journalctl --since="2012-10-3018:17:16"

journalctl --since "20 minago"

journalctl --since yesterday

journalctl --since"2015-01-10" --until "2015-01-11 03:00"

journalctl --since 09:00 --until"1 hour ago"

journalctl --since"15:15" --until now
Copy the code

Example Query the logs of the specified process

journalctl  _PID=1
Copy the code

View the logs of a specified user

journalctl _UID=33 --since today
Copy the code

Reference material

Journalctl Indicates the method to view logs

END

Welcome to pay attention to the public number programmer tool set 👍👍 is committed to sharing excellent open source projects, learning resources, common tools

Reply keyword “attention package”, send you a complete map of programmer skills.

Reply keyword “wX” add personal wechat, hook up with the author, welcome to chat ^-^.