Introduction to the Command Line

Prior to learning GDAL or scripting it is important to learn the Command Line and how to use commands from the command prompt.

2. Viewing the contents of a directory

Start the online DOS emulator if you haven't done yet.

C:\> is called the command prompt. It shows your current working directory (on Windows this is called a folder). In this case it means that you are at drive C (which is called the root). You cannot delete or edit the command prompt. You'll have to type the commands after the > of the command prompt.

1. Type the following command after the prompt:
doskey
After typing a command press the <ENTER> key to execute the command.

In the instructions we use <> to indicate that you have to press a key.

In this case we activated the logging of the command history that we'll use and explain further in Chapter 6.

We will view the contents of a directory by using the dir command. The dir command stands for "directory".

2. Type the following command after the prompt:

dir <ENTER>

You will see this:


This is called a directory list. A directory list is a list of all the files and subdirectories that a directory contains. If you type dir /? you will see all options of the dir command. For example, if you type dir /w you will see the directory listing in columns.

3. Try these commands to see what is on the C drive.