
P A R T I
C O N N E C T I N G T H E B O A R D
44
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
—The
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 oldfile 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.
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 book, 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.
Summary of Contents for A
Page 1: ......
Page 2: ......
Page 3: ...Raspberry Pi User Guide 2nd Edition...
Page 4: ......
Page 5: ...Raspberry Pi User Guide 2nd Edition Eben Upton and Gareth Halfacree...
Page 10: ......
Page 26: ...R A S P B E R R Y P I U S E R G U I D E S E C O N D E D I T I O N 10...
Page 28: ......
Page 29: ...Chapter 1 Meet the Raspberry Pi...
Page 37: ...Chapter 2 Getting Started with the Raspberry Pi...
Page 56: ......
Page 57: ...Chapter 3 Linux System Administration...
Page 79: ...Chapter 4 Troubleshooting...
Page 89: ...Chapter 5 Network Configuration...
Page 109: ...Chapter 6 The Raspberry Pi Software Configuration Tool...
Page 122: ......
Page 123: ...Chapter 7 Advanced Raspberry Pi Configuration...
Page 140: ......
Page 141: ...Chapter 8 The Pi as a Home Theatre PC...
Page 151: ...Chapter 9 The Pi as a Productivity Machine...
Page 160: ......
Page 161: ...Chapter 10 The Pi as a Web Server...
Page 172: ......
Page 173: ...Chapter 11 An Introduction to Scratch...
Page 189: ...Chapter 12 An Introduction to Python...
Page 216: ......
Page 218: ......
Page 219: ...Chapter 13 Learning to Hack Hardware...
Page 234: ......
Page 235: ...Chapter 14 The GPIO Port...
Page 249: ...Chapter 15 The Raspberry Pi Camera Module...
Page 265: ...Chapter 16 Add on Boards...
Page 280: ......
Page 281: ...Appendix A Python Recipes...
Page 287: ...Appendix B Raspberry Pi Camera Module Quick Reference...
Page 293: ...Appendix C HDMI Display Modes...