সোমবার, জানুয়ারী ২৪, ২০১১

DOS Tutorial Go to Contents


A quick and simple DOS tutorial.


What is DOS?

  MS-DOS is a "Disk Operating System". That means it is simply: "a System for Operating the Disks", (but MS-SOD doesn't sound as nice). In practice however, just as Windows does more than just print windows, DOS does more than just operate the disks: It enables the user to organise data files, load and execute (run) program files, and control the input and output devices attached to the computer. There are other brands of DOS besides the most well known "MS-DOS", ie: PC-DOS, DR-DOS/OPENDOS. Generally speaking, they will all function in the same way, especially at the most simple level.

What is Booting?

  To run DOS on a computer, it should be the first program to be executed when the computer is switched on. This led to a problem for the designers: "How can DOS be loaded and executed when there is no DOS program running to load and execute *it*??!!". Well, just as the fictional Baron Munchausen managed to pull himself up by his own bootstraps, the computer manages this seemingly impossible trick, and the term "bootstrapping", or "booting up" is applied to this process.

How do you communicate with DOS?

  DOS is an entirely text based system. All it provides for the user is a prompt: "C:>" or "A:>", where the user can type in commands from the keyboard. The system is entirely case insensitive: so either "ForMAt C:" or "format c:" would erase your hard disk...

  The latter example is of course a small warning: with DOS comes power, you can very easily mess up your system if you use powerful commands in the wrong way. The commands you should be careful of are: "Format", "Recover", and "Del". All of these perform useful functions, when used correctly, and all the others are pretty much safe to use.

How does DOS organise disks?

  DOS works within a file, directory and disk drive structure. This means that all program and data files are named, and grouped together in named directories on disks. 'Directories' are just lists of files.

How are files named?

  While newer versions of DOS support longer filenames, the standard DOS filename format remains: 1-8 letter name, period, 3 letter extension eg:

  PROGRAM.EXE
  DATA.DAT
  LETTER.DOC


  The extension to a file's name is there to allow files of a similar type to be grouped together. Ie. all wordprocessor files might have the extension .DOC, while all picture files might have the extension .PIC While these extensions can be specified by the user, many programs have used them to differentiate between formats, and so they have gradually become standardised. For example you would expect a ".TXT" file to be a file containing unformatted text, or a ".BMP" file to be in a bit mapped graphics file format.

  To completely specify a file on your computer you must specify its drive and directory path, and its filename. However a file does not always have to be specified in this complete form: If it is in the current directory, then you can just enter its filename.

How are directories named?

  Every disk drive has a root directory which can have subdirectories which are named in the same format as filenames, (though generally without any extension). The subdirectories can have subdirectories and so on. Eg: a floppy disk might contain the following directory structure:

  PICTURES
    HOLIDAY
      ITALY
      FRANCE
    FAMILY
    PETS
  TEXT
    LETTERS
    EMAIL

  A directory path name includes the disk drive and all subdirectories needed to specify a directory on a disk. The disk drive is specified by a single letter. Eg: The floppy disk drive is A and the hard disk drive is C.

  The drive letter, is followed by a colon, the directory path names are separated by backward slashes (\), (*Not* forward slashes like internet addresses). Eg. In the above example "A:\PICTURES\HOLIDAY\FRANCE" would be more than likely to contain pictures of a few baguettes and onions.

How is DOS used?

  When you type anything at the DOS prompt, and press enter, you are telling DOS to run a program.

  It will first look to see if there is an internal command program which has that name, and if it does not find one, then it will look to see if there is a file on disk with that name.

  If it finds an external file with the extension .COM (command), or .EXE (executable), then the program is loaded and run. At this point DOS looses control of the computer until the program has ended. However parts of it are still used by the programs as they are running, eg to load and save files etc.

Some very useful internal DOS commands:


  A: - Change current directory path to the floppy disk drive
  C: - Change current directory path to the hard disk drive
  DIR - Display current directory (show all files and sub-directories).
  MD - Make a new directory, eg: MD C:\EMAIL
  CD - Change current directory, eg. CD C:\EMAIL
  COPY - Copy file(s) from one place to another.
  Del - Delete/erase a file

  Any other text on the input line after the file name, is passed to the program. This means that in the command "Copy help.txt help.bak", the text, "help.txt and help.bak" is passed to the copy program which will in this case use it to specify source and destination files for a copy.


DOS usage examples:


  DIR [enter]

      Displays the current directory listing.


  DIR *.txt [enter]

      Displays any files in the current directory with .TXT as their extension


  DIR A:\PICTURES[enter]

      Displays a directory listing for the path, A:\PICTURES


  A: [enter]
  CD PICTURES [enter]
  DIR

      Change to the floppy disk drive, change the current directory, and then list the files.


  COPY letter.txt letter.bak [enter]

      Copy the file "letter.txt" to a file called "letter.bak". (Creates "letter.bak" if it does not exist, and overwrites it if it does).


  COPY A:\pictures\*.pic C:\ [enter]

      Copy any file with an extension PIC, in the PICTURES directory on the floppy disk drive to the root directory of the hard disk.


Other useful things to learn about DOS:


  DOS commands can be listed and automatically executed in predefined sequence in a batch file. (File extension .BAT), this is an extremely powerful and useful feature. Batch files are run in the same way as COM or EXE files, by simply entering the batch filename at the DOS prompt.

  SET PATH=directorypath;directorypath will force DOS to look in these directories every time it is told to run a file.

  PROMPT $_$p$_What now? will tell DOS to display the current directory together with a more friendly prompt for input.

  ? - in a filename stands for any digit or letter.

  * - in a filename is a wildcard which stands for any combination of digits or letters Eg "Del *.txt" would erase any the files with extension txt in a directory.

  . - in a directory path stands for the current directory.

  .. - in a directory path stands for the directory above the current directory, Eg: C:\PICTURES when the current directory is: C:\PICTURES\HOLIDAY

  SUBST X: C:\ Drive letters can also be used to stand for directories on the hard disk, this allows long pathnames, eg: "c:\dos\packages\wordpro\data" to be written as short drive letters, eg: "x:". These can then be used in all subsequent commands.






কোন মন্তব্য নেই:

একটি মন্তব্য পোস্ট করুন