Week 1: computer and file system intro
2013-01-13
We'll talk about file system navigation, text editors, and a general computer
overview.
Class notes
Notes from week 1.
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 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.
-
Navigation
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
Some helpful links:
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.