IO pin control from the command line

Elevate your permissions to root user to allow IO access sudo -i Setup to control pin as output Substitute 23 in the following commands for your GPIO number (GPIO, not pin number) echo "23" > /sys/class/gpio/export echo "out" > /sys/class/gpio/gpio23/direction Control Output State echo "1" > /sys/class/gpio/gpio23/value echo "0" > /sys/class/gpio/gpio23/value Setup to read pin […]

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

.Command Line General

Good Resources The Linux Command Line – free pdf book Get previously entered commands Use the up and down cursor keys. Issuing multiple commands in a single line If subsequent commands should only occur if the previous command succeeded use "&&": sudo ifdown eth0 && sudo ifup eth0 If subsequent commands should occur regardless of […]

Read More

Root user privileges

After logging in as user pi, using this command give you root user privileges: sudo su Exiting root user mode Use the exit command: exit or su username: su pi sudo In GUI If you are developing programs which use the IO pin from the GUI you do not have to use "sudo startx" to […]

Read More

Soft Reset

For the Debian installation at the command prompt enter: sudo shutdown "now" -r You can also use: sudo reboot

Read More