Or Commands for the Terminal
Note
: there are two “modes” you can work with in Linux. One is a user mode with basic access privileges, and the other is a mode with administrator access privileges (AKA super user, or root). Certain tasks cannot be performed with basic privileges and you will need to enter into root mode to perform them. You will frequently see the prefix sudo before commands, which means that you are telling the computer to operate the command with super user privileges.
This will require the root password. Another option is to access the root command prompt, which operates all commands with super user privileges. You can enter root mode by entering sudo su at the command prompt. After entering sudo su, you will see the root@raspberrypi:/home/pi# command prompt, and all subsequent commands can be entered without the sudo prefix and still have super user privileges.
Please do not do this often, because you risk corrupting the software.
cat /proc/meminfo: Shows details about your memory.
pi@raspberrypi ~ $ cat /proc/meminfo
MemTotal: 883908 kB
MemFree: 483564 kB
MemAvailable: 792000 kB
Buffers: 57944 kB
Cached: 260412 kB
SwapCached: 0 kB
Active: 248736 kB
Inactive: 106836 kB
Active(anon): 37324 kB
Inactive(anon): 688 kB
Active(file): 211412 kB
Inactive(file): 106148 kB
Unevictable: 0 kB
Mlocked: 0 kB
SwapTotal: 0 kB
SwapFree: 0 kB
Dirty: 188 kB
Writeback: 0 kB
AnonPages: 37212 kB
Mapped: 31812 kB
Shmem: 800 kB
Slab: 31180 kB
SReclaimable: 21596 kB
SUnreclaim: 9584 kB
KernelStack: 1520 kB
PageTables: 1512 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 441952 kB
Committed_AS: 298988 kB
VmallocTotal: 1171456 kB
VmallocUsed: 1824 kB
VmallocChunk: 949592 kB
cat /proc/partitions: Shows the size and number of partitions on your SD card or hard drive.
pi@raspberrypi ~ $ cat /proc/partitions
major minor #blocks name
7 0 986256 loop0
179 0 31636480 mmcblk0
179 1 64512 mmcblk0p1
179 2 31570944 mmcblk0p2
cat /proc/version: Shows you which version of the Raspberry Pi you are using.
pi@raspberrypi ~ $ cat /proc/version
Linux version 3.18.6-v7i-aufs (max@lynx) (gcc version 4.8.4 (Buildroot 2015.02-git-g537b3c0-dirty) ) #1 SMP PREEMPT Tue Feb 10 22:35:34 CET 2015
df -h: Shows information about the available disk space.
pi@raspberrypi ~ $ df -h
df: `/squashfs': No such file or directory
Filesystem Size Used Avail Use% Mounted on
rootfs 30G 6.4G 22G 23% /
dev 423M 0 423M 0% /dev
/dev/mmcblk0p2 30G 6.4G 22G 23% /mnt
none 30G 6.4G 22G 23% /
tmpfs 87M 256K 87M 1% /run
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 173M 0 173M 0% /run/shm
/dev/mmcblk0p1 63M 36M 28M 57% /media/12D6-E54E
dpkg --get-selections | grep XXX: Shows all of the installed packages that are related to XXX.
pi@raspberrypi ~ $ dpkg --get-selections | grep python
idle-python2.7 install
idle-python3.2 install
libpython2.7 install
python install
python-dbus install
python-dbus-dev install
python-gi install
python-minecraftpi install
python-minimal install
python-numpy install
python-picamera install
python-pifacecommon install
python-pifacedigitalio install
python-pygame install
python-rpi.gpio install
python-serial install
python-support install
python-tk install
python2.7 install
python2.7-minimal install
python3 install
python3-minimal install
python3-numpy install
python3-picamera install
python3-pifacecommon install
python3-pifacedigital-scratch-handler install
python3-pifacedigitalio install
python3-pygame install
python3-rpi.gpio install
python3-serial install
python3-tk install
python3.2 install
python3.2-minimal install
dpkg –get-selections: Shows all of your installed packages (
Could be a very very long list).
free -m: Shows how much free memory is available.
pi@raspberrypi ~ $ free -m
total used free shared buffers cached
Mem: 863 390 472 0 56 254
-/+ buffers/cache: 79 783
Swap: 0 0 0
lsusb: Lists USB hardware connected to your Raspberry Pi.
pi@raspberrypi ~ $ lsusb
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 0bda:8176 Realtek Semiconductor Corp. RTL8188CUS 802.11n WLAN Adapter
Bus 001 Device 005: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
Bus 001 Device 006: ID 0bda:2832 Realtek Semiconductor Corp. RTL2832U DVB-T
Bus 001 Device 007: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
UP key: Pressing the UP key will enter the last command entered into the command prompt. This is a quick way to correct commands that were made in error.
vcgencmd measure_temp: Shows the temperature of the CPU.
pi@raspberrypi ~ $ vcgencmd measure_temp
temp=38.5'C
vcgencmd get_mem arm && vcgencmd get_mem gpu: Shows the memory split between the CPU and GPU.
pi@raspberrypi ~ $ vcgencmd get_mem arm && vcgencmd get_mem gpu
arm=880M
gpu=128M
Top Comments