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 […]
Category: Command Line
COM Ports(1)
Command Line Window Tools(1)
File System(4)
IO Pins(2)
Package Managers(1)
Permissions(1)
SSH Tools(1)
wget(1)
Break
On the Raspberry Pi Command Line Break CTRL + Break Via SSH Terminal Programs CTRL + C
Detect RPi Hardware Version
Get Human Readable Hardware Details cat /proc/cpuinfo Get RPi Version Code Use the command: cat /proc/cpuinfo | grep 'Revision' | awk '{print $3}' The returned code can be looked up on the table at http://www.raspberrypi-spy.co.uk/2012/09/checking-your-raspberry-pi-board-version/ , copied below:
Help
Displaying a programs options Type this on the command line: program_name –help
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
Networking
More Networking Things Our Raspbian specific networking stuff is here: https://raspberry-projects.com/pi/category/pi-operating-systems/raspbian/network-settings 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. Get connected […]
Processes
Show processes ps -ef List processes ps ax List processes To kill a running program If you need to kill your program running in the background you can use this sudo killall my_project.a
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 […]
Searching For Files
Install mlocate sudo apt-get install mlocate sudo updatedb Then use locate my_filename.a
Shutdown
This is the best method sudo shutdown -h now This is an alternative (halt and shutdown are not the same thing so a halt command may not cause a complete power off shutdown, it depends on the system): sudo halt