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".
#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.
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:
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]
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:
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:
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!