Basic scripting
All the commands that you have seen so far are just single commands. The bash has the ability to execute multiple commands together in one go. Commands can be stored in a file called a shell script.
A shell script has its execute attribute set. It can then be run by simply changing into the directory that the script is in and typing its name.
These shell scripts can be run as normal program a on your Raspberry Pi.
Rebooting and shutting down your Raspberry Pi
You can reboot and shut down your Raspberry Pi using the built-in commands. To reboot your Raspberry Pi, all you need to do is run the reboot
command.
Sometimes, you will want to shut down your Raspberry Pi completely. To do this, you can use the shutdown
command.
The shutdown
command takes two different parameters: the first parameter is the type of shutdown that you want to do, and the second parameter is the time at which you want to do the shutdown.
Parameter |
Description |
---|---|
|
This reboots... |