Shut Down and Reboot the Pi

When you’re finished with your work, don’t simply switch off the Pi. It might result in the loss of data. Always shut it down using the following command:

 
pi@raspberrypi ~ $ ​sudo halt

If you need to reboot the Pi, use the following command:

 
pi@raspberrypi ~ $ ​sudo reboot

Get Raspberry Pi, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.