Text Files – Viewing

Viewing Text Files head – View the start of a text file Show the first 20 lines: head -20 /home/pi/mytextfile.txt tail – View the end of a text tile Show the last 20 lines tail -20 /home/pi/mytextfile.txt  

Read More

sudo

Becoming the root user sudo su Which users are allowed to use sudo You can use this command to open the sudoers file: sudo nano /etc/sudoers BE VERY CAREFUL TO COPY THIS FILE BEFORE YOU CHANGE IT – IF YOU MAKE AN ERROR YOU CAN STOP YOURSELF BEING ABLE TO OPEN THE FILE USING SUDO (changes […]

Read More

Installing

Fixing broken installs You can use the "–fix-missing" option to retry an install and look for items that we're previously missed due to errors sudo apt-get install somename –fix-missing  

Read More

Update Packages

Updating all installed packages sudo apt-get update sudo apt-get upgrade or sudo apt-get update; sudo apt-get upgrade  

Read More

Networking

IP Address ip addr Is A Specific Interface Connected ip link show wlan0 WiFi List discovered networks sudo iwlist wlan0 scan Is network connected ifconfig wlan0 If the inet addr field has an address beside it, the RPi has connected to the network.   

Read More

Break

On the Raspberry Pi Command Line Break CTRL + Break Via SSH Terminal Programs CTRL + C

Read More

tar, for zipping files, directories, etc

Show all options tar –help Create Archive Of Specific Files tar -vfcz outputfilename.gz inputfile1 inputfile2 Zipping Files And Directories Use this to move to the directory containing the files and / or directories you want to zip cd projects/myfolder Zip 1 File tar -vczf zip_output_filename.gz file_to_zip.a Zip 2 Files tar -vczf zip_output_filename.gz file_to_zip1.a file_to_zip2.a Zip A […]

Read More

Help

Displaying a programs options Type this on the command line: program_name –help        

Read More

Sleep

Can be useful when chainging commands together in scripts etc: sleep 5 Will ause a pause of 5 second    

Read More