Many tasks on Raspberry Pi can be performed by typing in commands. These commands can be used in terminal mode, sometimes called command prompt mode. The commands are listed here by topic with a description and the command information. For most examples below, commands are shown inside of quote marks, but those are not needed when typing the command at the command line.
- Active Monitoring. For some commands, it is desirable to have the resulting output updated regularly for continuous monitoring, such as temperature. You can do this with a “watch” modifier. So, for example, to continually monitor temperature you can use this command: watch vcgencmd measure_temp
- Root Login – Disable. If you have enabled the root user account login as described below and subsequently want to disable it, you can use this command which causes root to have an invalid password and thus not work for login: sudo usermod –pass=”*” root
- Root Login – Enable. Normally one would avoid enabling root login because if you login using the root user account, you will be logged in as a super-user with the potential for harmig the computer file system if you do something incorrectly. The only time to use this would be if you have attached a hard drive with user permissions that are making it difficult to recover files.
(1) Type “sudo su –” and press enter.
(2) Then type “sudo passwd” to set a root password.
(3) Logout of your Raspberry Pi user account and from the login screen username drop-down menu choose Other and then type in root and the password you set in step #2 above.
- Software – Install. To install a software program, use this command: sudo apt install [package-name]
- Software – Remove. To remove a software program, use this command: sudo apt remove [package-name]
- Temperature. If you are running an intensive task on your Raspberry Pi, the processor temperature could rise which can cause the processor to slow down. This is caused throttling. If you have poor passive cooling, or inadequate active cooling (with a fan), and the temperature gets too high, the unit could become damaged. You can check the temperature with this command: vcgencmd measure_temp
- Throttling Status. If you are concerned about your Raspberry Pi overheating and causing throttling, you can check the throttling status with this command which should return a zero x zero result: vcgencmd get_throttled