Java Reference
In-Depth Information
DO NOT TYPE IN THE DOLLAR SIGN ( $ ). I'll show it to indicate where you
type, but you don't type the $ :
$ you type this part here, but not the dollar sign
When you're done typing in a command and want the computer to run it,
press the Enter (or Return ) key on your keyboard. That's the easy part. Next
you just need to learn a few basic commands to type in!
You can list the files and directories with the directory listing command:
$ ls
To change your current directory, you use the change directory command.
For example, to change the directory to the Desktop, you'd type
$ cd Desktop
and be transported to the Desktop (or any other directory whose name you enter).
For instance, when your shell first opens up, you'll be in some sort of default
directory or folder (sometimes called a home directory). You can see what files
are there by typing the command ls (short for “list files”) and pressing Return .
(On stock Windows using cmd.exe , you'd have to type dir (short for “directory
listing”) instead. Also, while the rest of the world uses a “/” in directory names,
Windows uses a “\.” These and other tiresome differences are why I recom-
mend using the POSIX-standard bash shell for Windows as described in the
box on page 4 .)
You'll see a listing of a bunch of files. Type cd Desktop , and you'll be in your
Desktop directory. Type the command ls , and you'll see a list of all the files
on the Desktop. Now you're working at the command line! Let's delve into
that a little bit more.
Move Around in File Directories
Normally when you want to look at files on your computer's hard drive, you
use graphical programs like Explorer on Windows or the Finder on Mac. Either
way, the idea is to show you the files, folders/directories, and applications/pro-
grams on the computer so you can navigate around and run things.
We're doing the same thing here, but in a more powerful way and without
graphics. If you're already familiar with doing this, please feel free to skip to
the end of this chapter for a small treat. Otherwise, read on.
 
 
Search WWH ::




Custom Search