User Tools

Site Tools


Useful Commands


This command executes a command in behalf of the user root (replace *yourcommand* with the command you want to execute).

sudo *yourcommand*

This command changes the username to root including all rights.

sudo su -

Network Interfaces

Show a short summary about all network interfaces including MAC address, IP-address and statistics for sent and received packets.


Show a short summary about all wireless network interfaces with additional wireless (SSID, frequency, etc.) information.


Show a list of all visible wireless networks in range (in this case for the WLAN device wlan0).

iwlist wlan0 scan

USB devices

List all USB devices.



Show the last message from the kernel ring buffer. Is sometimes helpful when installing new hardware.


Reboot the Raspberry PI.

sudo reboot

Shutdown the Raspberry PI.

sudo shutdown -h now

Update the Raspberry PI Firmware.

sudo rpi-update

Use this command with caution and only, when you know, what you are doing. This downloads the latest kernel from github. Be aware, this might also be an unstable kernel! So usually there is not need for executing this command! If a kernel is tested and stable you will get it anyway, by calling sudo apt-get dist-upgrade.

If you update the kernel with the current one, this produces an output like this one:

pi@RaspberryPi ~ $ sudo rpi-update 
 *** Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS and Dom
 *** Performing self-update
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  7037  100  7037    0     0  20974      0 --:--:-- --:--:-- --:--:-- 30072
 *** Relaunching after update
 *** Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS and Dom
 *** We're running for the first time
 *** Backing up files (this will take a few minutes)
 *** Backing up firmware
 *** Backing up modules 3.12.22+
 *** Downloading specific firmware revision (this will take a few minutes)
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   168  100   168    0     0    252      0 --:--:-- --:--:-- --:--:--   356
100 21.2M  100 21.2M    0     0   559k      0  0:00:38  0:00:38 --:--:--  554k
 *** Updating firmware
 *** Updating kernel modules
 *** depmod 3.12.26+
 *** Updating VideoCore libraries
 *** Using HardFP libraries
 *** Updating SDK
 *** Running ldconfig
 *** Storing current firmware revision
 *** Deleting downloaded files
 *** Syncing changes to disk
 *** If no errors appeared, your firmware was successfully updated to e38850519c56b835dbd1c81e04d9307e154c36ed
 *** A reboot is needed to activate the new firmware

Update installed packages (“stupid”: update existing packages if possible, no deletion)

sudo apt-get update
sudo apt-get upgrade

Update installed packages (“clever”: resolve conflicts by removing old packages in order to update another one)

sudo apt-get update
sudo apt-get dist-upgrade

Show Memory (used + free incl. SWAP-file)

free -m -t

Change default editor (in this example to editor “mcedit” as part of the midnight commander):

sudo update-alternatives --set editor /usr/bin/mcedit

If you first to have an overview over all installed/possible editors, just simply run that command and follow the options on screen:

sudo update-alternatives --config editor

File Sytem

Show free disk space


And to make it easier readable, you can add the param “-h”, like

df -h

Which returns something like (german output):

Dateisystem    Größe Benutzt Verf. Verw% Eingehängt auf
rootfs          7,3G    3,0G  4,0G   44% /
/dev/root       7,3G    3,0G  4,0G   44% /
devtmpfs        180M       0  180M    0% /dev
tmpfs            38M    248K   38M    1% /run
tmpfs           5,0M       0  5,0M    0% /run/lock
tmpfs            75M       0   75M    0% /run/shm
/dev/mmcblk0p1   56M     19M   38M   33% /boot


Show the current temperature of the RaspberryPi CPU. The value divided by 1000 is the temperature in ° celsius.

cat /sys/class/thermal/thermal_zone0/temp

An example of a busy CPU could be:

pi@raspberrypi ~ $ cat /sys/class/thermal/thermal_zone0/temp

Here the CPU has a current temperature value of 62,142°C.

Or you get it directly formated like this temp=42.2°C.

vcgencmd measure_temp
commands.txt · Last modified: 21.03.2016 10:40 by andreas