Table A-1 shows some useful and common Linux commands. Table A-2 shows the directories you’ll be working in much of the time.
Command | Meaning |
| Prints your working directory |
| Lists files in working directory |
| Changes directory to the Desktop directory immediately under your current directory |
| Changes directory to the Desktop directory immediately under your home directory |
| Changes to your home directory |
| Edits the text file foo.txt. Use Control-X, then type |
| Change your password (asks for the old one first, but doesn’t echo what you type to the screen) |
| Launch the graphical desktop from a command-line-only Linux session |
| Updates the list of software you can install (requires a network connection) |
| Installs the program ipython |
| Prepares the Raspberry Pi to be powered off in a safe way |
| Edits a file as root, with more safety checks than |
| Shows the Pi’s IP addresses (127.0.0.1 is localhost, which is used for connections between programs running on the Pi; use the other one, which is your Ethernet or WiFi adapter) |
| Calls up the configuration menu of most common Raspberry Pi settings (you’ll usually need to reboot after you run it) |
| Create a directory called bar |
| Remove the directory bar/ and its contents (there is no Undo) |
Connects to remote computer example.com with user “login” | |
| Close the shell or ssh connection |
| View a text file (press space for the next page, press |
| Follows the specified text file as lines are added to it (use Control-C to kill the tail command and return to the shell) |
| View the manual page (built-in documentation) of the command “ssh” (press space for the next page, press |
Directory | Purpose |
/home/pi/ | Your (you are the user named |
/var/log/ | Contains all the system-wide log files, such as /var/log/syslog and /var/log/auth.log |
/etc/ | Contains all the system-wide configuration files. |
/sys/ | A virtual file system for reading and modifying volatile data (things that change continuously as the system is running, such as input and output pins) |
/media/ | Removable media, such as /media/cdrom/ or /media/usbdisk/ |
/ | The root directory; contains every directory and file available on the system |