`#del` A>del *.* Are you sure? (Y/N) MS-DOS gives you a second chance before you erase all the files in the current directory. `#del` `#ram` RAM ......... random access memory The computer's short term memory. Programs must be loaded into RAM from a disk before they can be executed. `#ram` `#disk` FLOPPY DISK .. low capacity/removable HARD DISK .... high capacity/fixed `#disk` `#prog` Programs are collections of machine language codes which instruct the computer what to do. These codes are "binary" ones and zeros. `#prog` `FILES` `FILES` `BEGIN` ======================================================================= MS-DOS Tutorial Hypertext by Richard Rathe MD Copyright 1988 by Medical Decisions Software ======================================================================= ~INTRODUCTION~0~intro~ ~OVERVIEW~0~prompt~ ~FILES~0~files~ ~DIRECTORIES~0~direct~ ~COMMANDS~0~comm~ ~INDEX~0~index~ ~AUTHOR and COPYRIGHT~0~author~ MS-DOS tm MicroSoft Corp. IBM-PC tm International Business Machines Corp. `BEGIN` `intro` INTRODUCTION - What is an Operating System? ======================================================================= "MS-DOS" stands for MicroSoft Disk Operating System. "MS" tells us that MS-DOS is a product of the MicroSoft corporation. The word "disk" is historical - not all early computers used floppy disks as found on the IBM-PC. So what is an "operating system"? To understand this one must first look at the two basic divisions of a desk top computer, hardware and software. Hardware is "hard" because we can reach out and touch it. Software is "soft" for the opposite reason. Although we can touch the disk or tape a program is recorded on, the program itself is intangible, much like music on a cassette tape. An operating system provides the essential link between these ~physical and logical worlds~0~hardsoft~. MS-DOS is a special piece of software which understands the internal workings of an IBM-PC. It is one of several possible operating systems for the IBM-PC class of computers. MS-DOS represents the closest thing to a "standard" operating system for this type of computer. The MS-DOS software has an intimate association with the computer's hardware. The computer could not "run" without this association. MS-DOS is the entity which "knows" how to run a program, how to read and write a disk, and how to recover from errors (sometimes). As you can see, anyone using an IBM-PC will, for better or worse, come to rely on MS-DOS. ~CONTINUE TUTORIAL~0~prompt~ `intro` `hardsoft` #=================# | | "SOFTWARE" | ~PROGRAMS~0~#prog~ | | | |-----------------| | | | MS-DOS | <-> ~command.com~0~com~ Logical | | -------------------|-----------------|-------------------- Physical | | | COMPUTER | <-> keyboard/screen | | |-----------------| | || | "HARDWARE" | ~RAM~0~#ram~ || ~DISK~0~#disk~ | | || | #=================# `hardsoft` `prompt` `prompt2` OVERVIEW - The "A" Prompt ======================================================================= MS-DOS lets you know it is ready for action by displaying a prompt on the screen: A> (or some variation) The "A" tells you that disk drive A is the current or "logged" drive. This means that unless you specificly tell it, the computer will read and write using drive A. Most computers have at least two ~disk drives~0~#disk~, A and B (two floppies) or A and C (one floppy/one hard). The most basic MS-DOS command changes the current drive. A> "C:" The prompt will now change to: C> `prompt2` Disk drives are always specified as a letter followed by a colon. One can go back to drive A by issueing the command: C> "A:" Now that we have identified the disk we are interested in the next logical question is, "What's on it?". The directory command provides the answer. A> "dir" might give: Directory of A:\SAMPLE . 01-06-86 7:30p .. 01-06-86 7:30p ed exe 45897 01-06-86 7:30p junk txt 12034 03-15-88 10:04a 4 File(s) 301560 Bytes Free Ignore the entries for this discussion and concentrate on the other two. "ed" might be a text editor and "junk" might be the text ~file~0~file2~ we wish to edit. The complete entry for "junk" reads: firstname: junk lastname: txt size: 12034 bytes created: March 15th 1988 at 10:04 AM What if we'd like to take a quick peek at "junk" to make sure it is the file we are interested in? Again MS-DOS has an answer: A> "type junk.txt" might give: This is a junk file. This file is not about anything in particular. It just rambles on... etc. Notice the use of a period "." to separate the first name from the last name of the file. Finally, we might decide to get rid of this file and edit a new one: A> "del junk.txt" (delete a file) A> "ed" (run program "ed.exe") ~CONTINUE TUTORIAL~0~files~ `prompt` `files` `file2` FILES ==================================================================== The basic package of information on a floppy or hard disk is the file. Files may be either programs or data. Each file has a filename associated with it of the form: firstname.lastname firstname = up to 8 letters or digits period (dot) "." lastname = up to 3 letters or digits (optional) `file2` This allows similar or related files to be grouped by common first and last names. Furthermore, MS-DOS allows the use of two "wildcard" characters to specify a group of files using a single filename. `wild` * ... match zero or more characters ? ... match zero or one character "junk*" matches: junk junk1 junk2 junkyard "junk?" matches: junk junk1 junk2 (not junkyard) "*.txt" matches: hello.txt letter.txt junk.txt "*.*" matches: all filenames `wild` `prog` There are special last names for certain types of files: ".exe" or ".com" for programs These are "machine language" or binary files. They are unreadable as text but they may be executed by MS-DOS. To run a program simply type in its first name. ".bat" for batch files These are "command language" files. They may be edited as plain text. MS-DOS commands and other programs can be "batched" together to run in a certain sequence under one name. To run a batch file simply type in its first name. `prog` ".sys" for system configuration files These files specify any additions or non-standard changes to the MS-DOS system. There are also files used by MS-DOS itself: autoexec.bat This is the MS-DOS start-up batch file. This will be the first command issued by MS-DOS after it is loaded. Any number of start-up commands may be contained in this file. config.sys This is the system configuration file. `com` command.com This is the MS-DOS command processor. This program is automaticly run by MS-DOS. It has three basic functions: 1)prompt the user with ~"A>"~0~prompt2~ to signal that the system is ready to do business 2) provide the ~"internal" commands~0~incomm~ (dir, type, del, etc.), 3) run programs and batch files. `com` ~CONTINUE TUTORIAL~0~direct~ `files` `direct` `subdir` DIRECTORIES ======================================================================= Any disk may be divided into "directories". This provides a convenient way of segregating files which belong together from the rest of the files on a disk. The importance of directories becomes clear as soon as you have to deal with hundreds or thousands of individual files on a hard disk. Directories are arranged in a branching tree like structure. Every disk has at least one directory called the "root" directory. The root directory is always represented by the "\" character. "C:\" (drive C / root directory) Other directories are created as the user sees fit. They are considered "subdirectories" of the root directory. These subdirectories may have their own subdirectories and so on creating a ~directory tree~0~dirtree~. A directory name is built by listing each subdirectory in order separated by a "\": "C:\USER\MARK\LETTERS" Directory specifications may be added to a file name to make its location specific for the computer: "C:\USER\MARK\LETTERS\MOM.LET" There can be several files called "mom.let" as long as they are in different directories. `subdir` There are three MS-DOS commands used to manipulate directories: CD - change directory MD - make directory RD - remove directory They are all used in the same way: "md jim" (make subdirectory ...\JIM in current directory) "cd jim" (change to subdirectory ...\JIM) "cd .." (change back to parent directory) "rd jim" (remove subdirectory ...\JIM) Notice that these commands are relative to your current position in the ~directory tree~0~dirtree~. If you started in directory "\USER" then "md jim" would create "\USER\JIM". The shorthand ".." represents the parent directory, in this case "\USER". To remove a directory it must be empty ("~del~0~#del~ ~*.*~0~wild~") and the parent directory must be current. CD without a directory specification will always return your current position. Subdirectories appear with a "" after them in any directory listing: Directory of A:\USER . 01-06-86 7:30p .. 01-06-86 7:30p ed exe 45897 01-06-86 7:30p junk txt 12034 03-15-88 10:04a jim 03-14-88 1:24p 5 File(s) 301560 Bytes Free ~CONTINUE TUTORIAL~0~comm~ `direct` `dirtree` LEVEL "\USER\MARK\LETTERS" "\USER\MARK\PROJECT" 3 | | |______"\USER\MARK"_____| "\USER\JANE" 2 | | "\PROG" |________"\USER_______| 1 | | |__________"\"___________| 0 | DIRECTORY TREE STRUCTURE `dirtree` `comm` MS-DOS COMMANDS ====================================================================== ~Internal commands~0~incomm~ are provided by "command.com" and are "built-in" to MS-DOS. They are available anytime you see the "A>" prompt. ~External commands~0~excomm~ are ordinary programs which are released as part of the MS-DOS system. They perform accessory functions that are not part of the formal operating system. `comm` `incomm` INTERNAL MS-DOS COMMANDS ====================================================================== `a:` A:, B:, C:, etc. - change drive Purpose: set default disk drive Usage: X: where X is the new drive letter Example: A> C: --> C> `a:` `cd` CD - change directory Purpose: display/set default directory Usage: cd [directory] Example: cd --> current directory cd \user --> change to directory \USER `cd` `copy` COPY - copy file Purpose: copy/concatenate file(s) Usage: copy source [distination] Example: copy a:*.* c: --> copy all file(s) on A to C copy junk1+junk2+junk3 junkall ---> three into one `copy` `date` DATE - system date Purpose: display/set system date Usage: date Example: date --> 03-11-88 `date` `del` DEL - delete Purpose: delete file(s) Usage: del filename Example: del *.txt --> files with last name "txt" deleted Note: <<< THIS COMMAND IS DANGEROUS!!! >>> ~del *.*~0~#del~ erases an entire directory `del` `dir` DIR - directory Purpose: list files in directory Usage: dir [drive] [directory] [filename] Example: dir \user --> files in \USER directory `dir` `md` MD - make directory Purpose: make new subdirectory Usage: md directory Example: md user --> make subdirectory USER in \ `md` `path` PATH - search path Purpose: set program search path(s) Usage: path [directory];[directory]... Example: path c:\;c:\prog `path` `rd` RD - remove directory Purpose: remove a subdirectory Usage: rd directory Example: rd user --> \USER removed `rd` `ren` REN - rename Purpose: rename a file Usage: ren oldfile newfile Example: ren letter.txt jack.let `ren` `time` TIME - system time Purpose: display/set system time Usage: time Example: time --> 10:23:00 `time` `type` TYPE - type file to screen Purpose: view text files Usage: type filename Example: type junk.txt `type` `incomm` `excomm` EXTERNAL MS-DOS COMMANDS ====================================================================== `diskcopy` DISKCOPY - copy entire disk Purpose: making backup copies of working disks Usage: diskcopy Example: diskcopy `diskcopy` `format` FORMAT - format a disk Purpose: prepare disk to receive data Usage: format drive Example: format a: Note: <<< THIS COMMAND IS DANGEROUS!!! >>> Formatting a disk erases everything on it. `format` `print` PRINT - print file(s) Purpose: send one or more files to the printer Usage: print filename [filename...] Example: print file1 file2 file3 `print` `sys` SYS - copy operating system Purpose: create a MS-DOS system disk any other disks are data only Usage: sys drive Example: sys a: `sys` `tree` TREE - list directory tree structure Purpose: show all directories (and files) Usage: tree Example: tree `tree` `excomm` `index` INDEX =================================================================== ~A: command~0~a:~ ~A> prompt~0~prompt2~ ~author~0~author~ ~basic commands~0~prompt~ ~batch files~0~prog~ ~CD change directory~0~cd~ ~COPY~0~copy~ ~DATE~0~date~ ~DELete~0~del~ ~DIRectory~0~dir~ ~directory tree~0~dirtree~ ~DISKCOPY~0~diskcopy~ ~external commands~0~excomm~ ~filenames~0~files~ ~FORMAT~0~format~ ~hardware vs software~0~hardsoft~ ~internal commands~0~incomm~ ~introduction~0~intro~ ~MD make directory~0~md~ ~PATH~0~path~ ~PRINT~0~print~ ~programs~0~prog~ ~RD remove directory~0~rd~ ~REName~0~ren~ ~subdirectories~0~subdir~ ~SYS~0~sys~ ~TIME~0~time~ ~TREE~0~tree~ ~TYPE~0~type~ ~wildcards~0~wild~ `index` `author` AUTHOR and COPYRIGHT ======================================================================= Author: Richard Rathe MD Purpose: Basic MS-DOS instruction Release: Shareware distribution with the HYTEXT hypertext system Copyright: Medical Decisions Software 30 Harris ST, #6 Acton, MA 01720 MAY BE COPIED BUT NOT SOLD FOR PROFIT!! Please see your MS-DOS documentation for specific details about your version of MS-DOS. This hypertext is only a guide. The author has made every attempt to supply accurate information however, NO LIABILITY ON THE PART OF THE AUTHOR OR COPYRIGHT HOLDER IS EXPRESSED OR IMPLIED! `author`