|
|
|
DOS mantra:
- Understand exactly what you want to do, then select the handiest tool to accomplish it.
- "command /?" will display help
- 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")!
- there is always a <space> between commands, switches, and arguments. You must hit <enter> when you're ready to execute your command.
DOS Part 1 - Day 2
Goals
In this session you will:
- use DOSKEY to improve your command-line interaction
- learn to use relative and absolute paths
- use the informational commands (VER, TIME, DATE, CLS)
- use the file commands (COPY, REN, MOVE, DEL, TYPE)
- use the environmental variable commands (SET, ECHO, PROMPT)
Review
Skill Test
- Get to a DOS prompt if you are not there already.
- Look at your prompt to figure out what drive and directory you are in.
- Go to your A: (floppy) drive.
- Look at your prompt again.
- View the help screen for the
DIR command.
- Look at the contents of your current directory
- From this location on your A: drive, view the contents of the c:\windows directory.
- Now view only the .ini files in c:\windows (or c:\winnt) directory
DOSKey p337
- necessary in 9*, less so in NT
- DOSKey gives your command line a history or memory.
- F7 shows your history p. 339
- F9 allows you to select a command line by number
- DOSKEY is resident only in the current DOS session/window.
Paths - relative v. absolutes paths p.82-3
absolute path: precise directions to a file, beginning with the root directory. Ex: "\windows\temp\myfile.txt"
relative path: subjective directions to a file, starting from your present directory subjective directions to a file, starting from your present directory.
Ex: temp\myfile.txt.
One special set of helpers for describing relative paths are:
. = "the current directory"
.. = "the parent directory" (one up)
Simple Information: VER p.41, DATE , TIME
CLS - clear your screen p.47
File handling commands
- COPY:
copy oldfile newfile
- REN (rename):
ren oldname newname
- MOVE:
move oldpath newpath
- DEL:
del filename
- RD:
del dirname p. 288
- DELTREE (WARNING: destroys entire directory):
del [path] p. 289
- TYPE (print to output the contents of a textfile): type filename
Environmental Variable commands p 553
Environmental variables are like little named "containers" in memory that can hold a value.
for example you might make "USER"="jason".
- SET:
set variable=value
- ECHO:
echo %variable% p554
- PROMPT: see the /? screen! This var controls the layout of the command prompt!
- change a var by overwriting it
- add to a var by appending:
set test=%test%;newstuff
Disc Utilities
- How discs work: FAT/NTFS
- defrag - making fragmented files contiguous
- scandisc - fixing disk errors
- format - normal and quick formatting
Batch files - lite! - Chap 10
- just like stacked command lines
- REMark out comments p.480
- an additional use for echo:
@echo off
- passing arguments: %1, %2, %3, etc. p. 492
- pause p482
http://www.mousetrap.net/syllabus/dos/day2.html
$Id: day2.orb,v 1.5 2001/11/01 16:05:27 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.
|
|