Home > Operation and Maintenance > Linux Operation and Maintenance > How to check shutdown time in linux

How to check shutdown time in linux

WBOY
Release: 2022-03-18 10:35:00
Original
7168 people have browsed it

In Linux, you can use the last command to view the shutdown time. This command is used to display the user’s latest login information. When the parameter is set to "-x shutdown", the system shutdown date and time can be displayed. Syntax for "last -x shutdown".

How to check shutdown time in linux

#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.

How to check the shutdown time of Linux

To check the shutdown time of Linux, use the last command. Run the last -x shutdown command to display the system shutdown date and time, as shown in the following figure:

How to check shutdown time in linux

Note: Of course, you can also check the last shutdown time through the pipeline, that is, run the last -x shutdown | head -1 command. The added head -1 parameter refers to outputting a line of information. .

Linux last command is used to display the user’s latest login information.

Usage permissions: all users.

Syntax

shell>> last [options]
Copy after login

Parameter description:

  • -R Omit the hostname field

  • -num Display the first num

  • username Display the login information of username

  • tty Restrict the login information to include the terminal code

Expand knowledge:

Check the Linux running time

Want to know how long the Linux operating system has been running and how much it has been running Days, hours and minutes, please use the uptime command with the -p parameter to intercept, that is, run the uptime -p command. The output information includes days, hours, and minutes, as shown in the following figure:

How to check shutdown time in linux

Check the reboot time under Linux

You can check the reboot date and specific time of the Linux system by running the last command and adding the -x reboot parameter. That is, run the last -x reboot command. The result is as shown below Shown:

How to check shutdown time in linux

Related recommendations: "Linux Video Tutorial"

The above is the detailed content of How to check shutdown time in linux. 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