How will I know?
Remember we said there’s good news and bad news?
Well, the bad news is that it can be quite tricky to find
commands if you don’t know what they’re called.
One helpful feature is the
man
keyword
search. This is done with the
-k
flag.
To search for all the programs related
to ‘browser’ on your system, run
man -k browser
. You’ll notice that
this lists graphical programs as well as
command line ones. This is because there’s
no real difference between the two. You
can launch windows from the terminal,
and sometimes even control them.
If you’ve got
Iceweasel
(a rebranded
version of
Firefox
) installed on your
Pi (it’s not on there by default), you
can open
TuxRadar.com
in a new
tab in a currently running
Iceweasel
window with the command
iceweasel
--new-tab
www.tuxradar.com
.
We’re now going to quickly introduce a few
useful commands.
rm
deletes (ReMoves)
a file.
mkdir
makes a new directory.
cp
copies a file from one place to another.
This one takes two arguments, the original
file and the new file.
cat
outputs the
contents of one or more text files. This
takes as many arguments as you want,
each one a text file, and simply spits their
contents out on to the terminal.
less
is
a more friendly way of viewing text files.
It lets you scroll up and down using the
arrow keys. To exit the program back to
the command line, press
Q
. We’ll use all
these commands in examples below, so
we won’t dwell on them for too long.
■
Probably the most important command in any Unix-like system is man, since it is the key to
understanding every other command. Take time to become familiar with the structure and language
used and it will make life easier in the future.
find
find
is a useful
command for
finding files on your
computer. You use
it in the format
find
location flags
.
For example, to
find every file on
your computer
that’s changed in
the last day, run
find / -mtime 1
There are more
details of what
this means, and
the different flags
that can be used
over the page.
13
Raspberry Pi User Guide.indd 13
08/07/2014 14:44