A screen window that gives you access to the command-line interface.
(e.g. LXTerminal)
Allows you to communicate with a computer using text commands.
username
Username that you used to log in.
username
hostname
Hostname of your device,
can be identified on a network.
username
hostname
The current directory,
represented by the ~ (tilde) symbol.
This is a referal to your home directory: /home/pi
directory
username
hostname
The prompt to enter a text command,
represented by the $ symbol.
directory
prompt
Directories = Folders
commands | Description |
---|---|
cat | Displays the contents (catalog) of the text file. |
cd | Change directory. For example, the command cd Desktop moves you into the Desktop directory. |
cd .. | Moves you up the directory tree to the parent directory. |
cp | Makes another copy of the file. |
clear | Allows you to clear the terminal. |
date | Displays the time and date. |
ls | Displays a list of files and folders in the current directory. |
ls -l | Provides a list that includes more detail about the files. The -l parameter is a lowercase L (for long), not the numeral 1. |
man | Displays the manual or description file for the command. |
mv | Moves a file to a new location. |
mkdir | Makes a new directory. |
nano | Opens the nano text editor. To open a specific text file, add the file name; for example, nano hello opens the hello text file. |
pwd | Prints the working directory (shows in which directory you are currently working in). |
rm abc | Deletes (removes) the file named abc. |
rmdir | Deletes (removes) a directory. |
startx | Launches the Raspbian desktop interface (GUI). |
Command | Description |
---|---|
sudo | Gives the user root or super user permissions. |
sudo apt-get install abc | Tells the Raspberry Pi to use the Internet to find, download, and install the application called abc. |
sudo apt-get update | Downloads information about any new versions available for applications on your Raspberry Pi. |
sudo apt-get upgrade | Installs available upgrades for all applications on your Raspberry Pi. |
sudo shutdown -h now | Shuts down (halts) the power to the Raspberry Pi. |
sudo shutdown -r now | Shuts down the power to the Raspberry Pi and then restarts it. |
Codecademy.com
@ https://www.codecademy.com/learn/learn-the-command-line
The MagPi Essensials eBook
@ https://www.raspberrypi.org/magpi/issues/essentials-bash-vol1/
by Zed Shaw
@ https://learnpythonthehardway.org/book/appendixa.html
print working directory
list content of directory
change directory
return to home directory
make a new directory
create and edit a file
create a new empty file
remove (delete) an empty directory
copy a file
move a file
view content of a file
Type the following commands into the LXTerminal window. Explain each step:
Type the following commands into the LXTerminal window. Explain each step:
Create and edit a text file in the LXTerminal window:
In the LXTerminal window: