时间相关 date

date: 查看或设置当前系统的时间

date +%Y-%m-%d:格式化显示时间,显示x年x月x日

hwclock: 显示硬件时钟时间(需要管理员权限)

日历相关 cal(ncal)

如果显示当前命令不存在,安装即可,apt install ncal

cal: 显示当前月的日历

cal 12 2024: 显示 2024 年 12 月的日历

cal -y 2024 或 cal 2024: 显示2004年的日历

cal -y:显示今年日历

uptime: 查看系统运行时间关机

重启以及登出

shutdown[关机、重启]时间

  • -h 关闭计算机

  • -r 重启计算机

立即关机:shutdown-h now

10分钟后关机:shutdown -h +10

23:30分关机:shutdown -h 23:30

立即重启:shutdown -r now

立即关闭计算机:shutdown

立即重启计算机:reboot