Skip to content

如何安全关闭和重启树莓派

git1
你可能还没有意识到,树莓派没有像普通pc那样的电源开关。许多人都是直接拔掉电源线,但是有一种更安全的方法来关闭树莓派而没有丢失数据或者损坏SD卡的风险。

[amazon_link asins=’B07BJ53TVT,B01CDBMT70,B01MDUA0H2′ template=’CopyOf-ProductGrid’ store=’boyd-23′ marketplace=’CN’ link_id=”]

安全地关闭树莓派

sudo shutdown -h now

-h会将系统挂起
now立即执行

[amazon_link asins=’B07BJ53TVT,B01CZWWERC,B01FZ7UN8G’ template=’CopyOf-ProductGrid’ store=’boyd-23′ marketplace=’CN’ link_id=”]

一个相同作用的更短命令是:sudo halt

你也可以告诉你的设备在一个特定时间关闭:

sudo shutdown -h 20

这将会告诉设备在20分钟后关闭。可以用hh:mm 24小时格式替换20如果你想在一个确切时间关闭(例如sudo shutdown -h 16:30)。

安全重启你的树莓派

sudo shutdown -r now

-r将会重启
now立即执行

一个相同作用的更短命令是:sudo reboot

通过使用这些命令而不是简单的拔掉电源线,你就不用担心数据丢失或者损坏SD卡了。

0 0 votes
Article Rating
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x