We'll talk about file system navigation, text editors, and a general computer overview.
File system navigation
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 typecmd
, and it will appear. Or you can hitwin-r
(hold theWindows
key and hitr
), and then typecmd
.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.
Navigation
dir
lists the contents of the working directory.cd
changes the working directory.
Creation/deletion
mkdir
creates directoriescopy
andmove
copy and move filesdel
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 thePATH
, use:set PATH=%PATH%;C:\Program Files\Notepad++
To make the change permanent, you can go into the system settings
- You can start any other program by typing its name on the command line.
Example:
Some helpful links:
- Long Windows shell tutorial.
- A command line reference, and another. These list a ton of commands that are available on most Windows computers.
Text editors
You'll need to become comfortable using a text editor. You can use whatever you'd like as long as it has a hex editor. We'll go over Notepad++. In Notepad++, to enable the hex editor plugin, you have to check the option to allow unstable plugins in the plugin install menu.
I can also help with Vim or Emacs, but those are much more complicated.
To make whatever editor you choose easier to use from the command line, you can add its binary install directory to your path.