type
status
date
slug
summary
tags
category
icon
password
由于运行 reboot 命令系统默认不需要输入密码,为了防止意外发生,必须设置关机提示。
编辑 .zshrc
$ vi ~/.zshrc
注意,如果使用 bash 的话,请编辑 .bashrc 文件。
追加内容
# Shutdown and restart confirmation alias shutdown="echo 'Are you sure?' If so, run /sbin/shutdown" alias reboot="echo 'Are you sure?' If so, run /sbin/reboot"
更新文件
$ source .zshrc
到此,每当运行 reboot 或者 shutdown 命令的时候,都会出现提示。
这只是其中一种笨方法,但是很简单。
- 作者:Jinva
- 链接:https://jinva.site/article/linux-reboot-and-poweroff-tips
- 声明:本文采用 CC BY-NC-SA 4.0 许可协议,转载请注明出处。
相关文章