squeak!
Syllabus Homepage
Course Overview
Course resources
Day 1
Day 2
Day 3
Day 4
Common errors
Internet Glossary
About Your Instructor
Credits: This site powered by the vi text editor, apache webserver, perl scripting, and Debian linux.
squeak!

DOS mantra:

  1. Understand exactly what you want to do, then select the handiest tool to accomplish it.
  2. "command /?" will display help
  3. Syntax is "command [switches] [arguments]"; hit the Enter key when you are ready to execute the command. Pay attention to the spaces ("when in doubt, space it out")!
  4. there is always a <space> between commands, switches, and arguments. You must hit <enter> when you're ready to execute your command.

DOS 1 - Day 3

Goals

In this session you will:
  • test your knowledge so far
  • learn how to format disks
  • use redirection, including infiles, outfiles, and pipes

Review!

Pop Quiz!

  1. insert your floppy
  2. go to the root directory of your floppy (HINT: check your prompt!)
  3. make a new directory called "popquiz"
  4. change directories to popquiz
  5. make two new directories called "pop_1" and "pop_2"
  6. change directories to pop_1
  7. make a file called "results.txt" containing the text "Hey, I know this stuff!". Check your work (HINT: use dir to see if your file is where you think it is)
  8. copy the results.txt to the parent directory of pop_1. Check your work!

format!

You format a disk to prepare it for use. In most cases, a format will put an FAT and other necessary components of the filesystem on the disk. It can take a while!
  • format a:
  • be sure to check out the /? on this command. There's a useful switch for quickformatting an already-formatted disk.

redirection

  • IO and the STanDard OUTput and STanDard INput.
  • type will print the contents of a file to STDOUT
    type [filename]
  • echo echoes/prints something to the STDOUT.
    Try something like echo "hello there" and see what happens. Then try echo %PATH%. echo also has another use in batch files which we'll cover later.
  • copy con is a way to write to a file directly from the console (ie, keyboard).
  • >, the "outfile operator". This sends STDOUT to a file, overwriting it if it previously existed. Do you remember rem > [filename]? Does it make more sense now?
    Try this: dir > dirfile. Now edit/type dirfile and see what you've got.
  • >>, the "append operator". Like the outfile operator only it appends (ie, adds to) the file.
    copy con > [filename]. Everything you type until you end the file with a CTRL-Z will be written to the file.
  • <, the "infile operator". This one's a bit more tricky, as it provides input to a running program.
    Activity: automate the quickformat process
  • |, pipe, the way to pipeline STDOUT from one process into STDIN of another one.
    example: dir c:\ | more

Homework

Please read pages 179-189 for next session.


http://www.mousetrap.net/syllabus/dos/day3.html
$Id: day3.orb,v 1.2 2001/11/01 15:27:18 mouse Exp $

Remember, your login is based on your machine's hostname, not on any other number.
~/[initials] refers to the subdirectory under your homedir, named after your initials. Everything except for .dotfiles will be stored in your ~/[initials] directory.


© 1995-2001 jason carr
Distributed under the terms of the GNU Free Documentation License.