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!
- insert your floppy
- go to the root directory of your floppy (HINT: check your prompt!)
- make a new directory called "popquiz"
- change directories to popquiz
- make two new directories called "pop_1" and "pop_2"
- change directories to pop_1
- 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)
- 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.