Hardware Reference
In-Depth Information
The Terminal and the GUI
As in OS X and Windows, there are typically two main ways to achieve a given goal in Linux:
through the graphical user interface (GUI) and through the command line (known in Linux
parlance as the console or the terminal ).
The appearance of various Linux distributions can be quite different, depending on the desk-
top environment in use. In this topic, the recommended Raspbian distribution is used, but
most of the commands you will be learning are entered at the terminal and are typically the
same across all distributions.
Where other distributions differ, you will be given alternative methods of achieving the
same goals.
Linux Basics
Although there are hundreds of different Linux distributions available, they all share a com-
mon set of tools known as commands . These tools, which are operated via the terminal, are
analogous to similar tools on Windows and OS X. To get started, you'll need to learn the fol-
lowing commands:
ls —Short for listing , ls provides a list of the contents of the current directory.
Alternatively, it can be called with the directory to be listed as an argument. As an
example, typing ls /home will provide a list of the contents of /home , regardless of
your current directory. The Windows equivalent is dir .
cd— An initialism of change directory , cd allows you to navigate your way through the
file system. Typing cd on its own puts you back in your home directory. Typing the
command along with the name of the directory you wish to move to, by contrast,
switches to that directory. Note that directories can be absolute or relative: cd boot
will move you to the directory called boot under your current directory, but cd /
boot will move you straight to the /boot directory wherever you are.
mv —he move command has two purposes in Linux: it allows a file to be moved from
one directory to another, and it also allows files to be renamed. That latter feature may
seem out of place, but in Linux terms, the file is being moved from one name to
another. The command is called as mv oldfil e newfil e.
rm —Short for remove , rm deletes files. Any file—or list of files—provided after the
command name will be deleted. The Windows equivalent is del , and the two share a
common requirement that care should be taken to ensure the right file is deleted.
 
Search WWH ::




Custom Search