09 Jan 2012 [ 185 week1 ]

We'll talk about file system navigation, text editors, and a general computer overview.

Here's a quick summary of what we'll do on the command line today.

• The command line shell program is called cmd.exe in Windows. To run, you can open the start menu and type cmd, and it will appear. Or you can hit win-r (hold the Windows key and hit r), and then type cmd.

• All interaction with the command line consists of typing commands followed by zero or more arguments, and then possibly redirecting input or output.

The behavior of commands can be modified by specifying flags, which for Windows programs usually begin with a /. The /? flag is common to many commands, and will display a help message.

Basic commands will look like:

command-name /flag-1 /flag-2 arg-1


To display help for a command, you can type: command-name /?

• The command line shell, like all other programs, always has a current directory, or working directory. In the shell, this is the directory you're currently looking at, just like if you had opened a graphical Explorer window to a directory.

• dir lists the contents of the working directory.
• cd changes the working directory.
• Creation/deletion

• mkdir creates directories
• copy and move copy and move files
• del deletes files (permanently!)
• Environment variables The shell (as well as other programs) can use environment variables to keep track of common information. The set command lists variables and their values, or can set variables to new values.

• Other programs

• You can start any other program by typing its name on the command line. Example: notepad my-text-file.txt.
• A program must be stored in one of the folders listed in the PATH environment variable in order for the command line to understand its name. To add a new folder (say, for example, C:\Program Files\Notepad++) to the PATH, use:

set PATH=%PATH%;C:\Program Files\Notepad++


To make the change permanent, you can go into the system settings