Computer Science

What is DOS and Important DOS Commands?

DOS (Disk Operating System) is an operating system that runs from a storage disk drive, such as a floppy disk, hard disk drive, or optical disc. It must provide a file system that is used to read, write and organize files on the storage drive. The first DOS was IBM PC DOS introduced by Microsoft in 1981.

What is DOS?

DOS stands for Disk Operating System. It is an operating system that runs over the storage disk drive. The first disk operating system was IBM PC DOS introduced by Microsoft for  IBM in 1981. DOS is a single-user operating system. A single user operating system allows only one user to work at a time.

What is MS-DOS?

what is dosMS-DOS stands of Microsoft Disk Operating System, developed for IBM PC and compatible computers during the 1980s to mid-1990s. MS-DOS is a command-line-based system, where the user enters all commands in the form of text and there is no graphical user interface like in Windows

 

What is DOS Command?

DOS commands are small programs used to perform a specific job. Each DOS command performs its dedicated task. Without these commands, it is impossible to work on the computer system. These commands exist in MS-DOS and used to interact with the operating system and other command-line based software.

If you are working on a computer with a Windows operating system (like Windows 10, 8, 7, etc.) then there is no need for DOS commands because MS-DOS is not available in windows. These commands can also be used in Windows with the help of  Command Prompt. These commands are called CMD commands.

There are three parts of DOS commands

  • Every command has a command name
  • Some commands needs one or more than one parameters that identify the object.
  • Some commands also include one or more switches, which modify the action being performed.

Internal Commands

Internal commands are inserted into computer memory during computer booting. These commands can’t be viewed, edited, detected or deleted because they are not present in the form of any file. MD, CD, TIME, DATE, COPY, COPR CON, TYPE, etc are common examples of internal commands.

External Commands 

External commands are stored in the computer memory after booting. These Commands can easily be viewed, copied, changed or deleted because they are present in the form of a file. FORMAT, COPY, PRINT, SYS, EDIT, TREE, SORT, PROMPT, etc are common examples of external commands.

What is the Command Prompt?

command promptCommand Prompt is the input field in a text-based user interface in Windows. It is an official Windows command processor used to execute the commands entered in it. A command prompt (cmd.exe) issues various commands like file management commands i.e copy/ delete or troubleshoot windows issues.

Sometimes command prompt incorrectly called MS-DOS or the DOS prompt, but it’s not MS-DOS.

What is DOS Prompt?

The DOS command prompt is an important part of the MS-DOS command-line interface (CLI). It is the basic setting for the interface, where the prompt sets the platform for executing command lines of code. he main function of the prompt is to guide the user where and how to enter command-line text.

The DOS command prompt was the most well-oriented way to interact with the personal computer before the innovation of Windows graphical user interfaces. When the user navigates within the operating system, other files, directories, and subdirectories may also be added to the prompt. The common prompt is “C:\”.

What is DOS Attack?

dos attackA “denial of service” or DoS attack is a type of cyber attack used to tie up a website’s resources making it inaccessible to its intended users by interrupting the device’s normal functioning. DoS attacks typically accomplish by flooding or overwhelming the traffic to the targeted that triggers a crash.

The first DoS attack was done by a young boy David Dennis at the age of 13y in 1974. Dennis wrote a program by using the “external” or “ext” command that forced some computers at research in a nearby university to power off.

An important type of DOS attack is a distributed denial-of-service (DDoS) attack that comes from distributed sources, like a botnet DDoS attack.

DOS Commands

Following is a list of important dos commands and what is their function.

  • CHDIR – shows the name or changes the current working directory.
  • CHKDSK –verifies a storage volume fix errors and displays a status report.
  • CLS – The CLS clears the terminal computer screen.
  • COMP – Compares any two files or two groups of files to show the differences.
  • COPY – used to create copies of existing files.
  • DATE – Display and allow the user to set the system date.
  • DEFRAG – Optimizes file fragmentation on a disk drive by reorganizing the files on the disk.
  • DEL – DEL (or the alternative form ERASE) is used to remove or erase one or more files or set of files.
  • DELTREE – IThe command is used to delete a directory with all files and subdirectories inside it.
  • DIR – Displays the directory of files and the contents of a directory.
  • DISKCOMP – It compares the contents of a floppy disk to another one.
  • ECHO – Displays messages or toggle commands on and off in batch files.
  • EDIT – EDIT is a full-screen text editor used to create and edit ASCII text files.
  • EXIT – Used to exits from the current command processor.
  • EXPAND – Expands is used to uncompress one or more than one compressed file.
  • FASTHELP – Displays information for a list of DOS commands.
  • FIND –The FIND command is a filter to find a specific string of text characters in one or more files and reports the location.
  • FOR – Performs repeated execution of a command for each out of a specified set of files.
  • FORMAT –  Erase the FAT entries as well as the root directory of the disk and formats it for MS-DOS files.
  • GRAPHICS – enables a way to print the contents of a graphics screen.
  • IF – Allows the specified condition, and only if it is true.
  • LABEL – Generate or amend or remove the label on a logical drive such as a floppy disk.
  • LOADHIGH and LH– used to uploads a program into the upper memory area.
  • MEM – Displays the total amount of memory usages.
  • MKDIR – Used to create a new directory. If the specified parent directory not exists, then it will be created.
  • MODE– Used to change graphics modes, keyboard settings, create code pages and build port redirection in order to configure system devices.
  • MOVE – Moves one or more files or to change the name of directories.
  • MSBACKUP– used to create a backup or restore one or more files.
  • PATH – create or define and displays a search path for executable files.
  • RENAME – A REN command is used to rename a filename.
  • RMDIR – Delete or erase a directory. the directory must be empty for the commands to succeed.
  • SHARE– It provides support and help support for file sharing and locking.
  • SORT – Sorts filters the lines in the input data stream and send them to the output data stream.
  • XCOPY – used to copy the entire directories, subdirectories, and files.

What is Command Com?

Command com is a port of DOS. It helps to boot the computer and load the internal DOS command into memory (RAM). It also provides the PROMT and command line on the Cathode Ray Tube (CRT)or simply monitor.

Examples of DOS Commands

Following are major examples of DOS commands:

DATE and TIME

Date command is used to show or set the current date. The time command is used to show or set the current time. For example

  1. Type: date and press enter.
  2. If the correct date is displayed, press return. If the date is incorrect, type the correct date and press return.
  3. Type: time and press enter.
  4. If the correct time is displayed, press return. If the time is incorrect, type the correct time and press return.

DIR Command

DIR command displays the following information:

  • Filenames
  • File extensions
  • Size of each file
  • Date and time the file was last updated
  1. At the C:\> type: dir and press return.
  2. The list of files will appear on the screen.

At the end of the list, there is a line that shows the number of bytes free on a hard drive.

Pause a Directory Listing

You can include a PAUSE command to your directory command which will permit you to see your directory one screen at a time.

  1. Type: dir/p and press return.
  2. The screen freezes after it fills the screen with the files that are listed first in the directory.
  3. Press the spacebar to continue listing your files.
  4. Continue to press the spacebar until you return back to the C:\> prompt.

View a Wide Listing of Files

When you need to quickly view your files, you can add a /W to the directory command. This will display your files into five columns on the screen.

  1. Type: dir/w and press enter.
  2. DOS will list only the name of your file and the file extension on the screen.

This command does not show the file size or the fate it was created.

Check for Single File

In spite of using the directory command to look for one specific file, you can type the name of the file after the DIR command at the C:\> prompt.

  1. Make sure that you are at your C:\> prompt.
  2. Type: dir format.com and press return.
  3. The screen will display a listing of the file or a file not found a message.

Check for a Group of Files

The * symbol is called wildcard and stands for any character or group of characters. This is helpful when you desire to list files that start with some specific letter or group.

  1. Type: dir* and press return
  2. All filenames that start with the letter C will be listed.

List Files with the Same Extensions

You can use the wildcard character * to show a group of files with the same extension.

  1. Type: dir*.bat and press enter
  2. All files with the .bat extension are listed.

Clear the Screen

When the screen is full of information, you may want to clear it. To do this, type CLS at the C:\> prompt and press enter.

Create a File with DOS

  1. Type: copy con info.txt and press enter.
  2. Type this message in the following format:

Sciencerack

Best website to learn about science.

  1. Press Ctrl+Z and press return.
  2. DOS sends you a message that 1 file(s) has been copied.
  3. Type: dir i* and press return.
  4. You can see the list of files beginning with the letter i.

Copy a File

You can use the COPY command to copy one file to another.

  1. Type: copy info.txt info2.txt and press return.
  2. DOS will inform you one file has been copied.
  3. Type: dir q* and press return.
  4. You should have two files listed with different names.

Note: the filenames cannot be more than eight characters in length. File extensions cannot be more than three characters in length.

Type a File with DOS

If you need to check the contents of a particular file or any DOS file, you will need to use the TYPE command.

  1. Type: type quick2.ltr and press return.
  2. DOS prints the contents of the file.

Rename a File

The RENAME commands let you rename a previous file with a new name.

  1. Type: ren info2.txt detail.txt and press return.
  2. Type: dir*.txt and press return.
  3. DOS lists the files that have the .txt extension.

Create a Subdirectory

To create a subdirectory, you will need to use the command MD.

  1. Type: md\info and press return.
  2. Type: dir*.and press return.
  3. Notice the *.will list only the subdirectories.

Move to a Subdirectory

CD command is used to move to a directory.

  1. Type: cd\info and press return.
  2. Type: cd and press return.
  3. The name of the directory is listed.

Move to the Parent Directory

provides a quick way to move from the current directory back to the parent directory.

  1. Type: cd.. and press return.
  2. You will return back to the C:\> prompt.

Copy a File into a Subdirectory

The copy command is used to copy files from one directory to another.

  1. Type: copy sales.txt\info and press return.
  2. DOS will list the files being copied.
  3. Type: dir\info and press return.
  4. Three files should be listed in the info subdirectory.

List Subdirectories

  1. Type: dir\*. And press return.
  2. All the subdirectories are listed.

Note: the backslash character \ directs DOS to read from the root directory. The*. Requests the listing of the subdirectories.

Delete a Single File

DEL command is used to delete files.

  1. Type: cd.. and press return.
  2. The prompt shows you that you are back in the root directory.
  3. Type: del sales.bob and press return.
  4. Type: dir sales.bob and press return.
  5. bob is no longer listed because it has been deleted.

Delete a Group of Files

By using the wildcard character* you can delete a group of files from your hard drive.

  1. Type: del quick.* and press return.
  2. Type: dir quick.* and press return.
  3. All Quick files have been deleted

Delete all Files in a Subdirectory

There are two rules you will need to follow before removing a subdirectory.

RULE 1: all files in the subdirectory must be deleted.

NOTE: never type DEL *.* when you are in the root directory. It will wipe out all DOS files that are compulsory to boot and operate the computer.

  1. Type: cd\info and press return.
  2. Type: dir and press return.
  3. Three files should be listed.
  4. Type: del *.* and press return.
  5. DOS will ask you if you are sure? (Y/N)
  6. Type: Y and press enter.

Now the subdirectory is empty, you can delete the subdirectory.

RULE 2: you cannot be in the subdirectory that you wish to remove. You will need to return to the root directory (C:\> prompt).

  1. Type: cd.. and press return.
  2. You should be back in the root directory.
  3. Type re\info and press return.
  4. Type: dir*.and press return.
  5. Notice that the info subdirectory is no longer listed.

Format

It is used to enable the hard disk or floppy disk for storing the data e.g.

C:\>  format A/S/V/Q

/S means to make a system disk

/V means to enter the volume label after the formatting.

/Q   Quick format

  1. At the C:\> prompt type: format a:
  2. The A drive will be the drive that you insert your disk into; hence, the a: after the format command and press return.
  3. You will be prompted with the message: “ inset new diskette for drive A: and press enter when ready”.
  4. Now insert the disk you wish to format press return.
  5. Once this formatting process is done, the following message will appear: “format completed.” Then you will be prompted for a volume label. Press enter again.
  6. Now you will be asked if you would like to format another disk (Y/N)? press N.

NOTE: if you receive a message like: “Track 0 bad” or “Disk. Unusable,” your disk may be the wrong capacity. You can get help with this error message by typing.

Disk-Copy Command

Sometimes there is a need to copy all the files on one floppy diskette to another floppy. First, you will need a blank formatted disk.

  1. Type: disk copy a: a: and press return.
  2. When asked to put in the source disk, put in the diskette that has the information you want to copy into drive A and press return.
  3. Wait a few seconds. When asked to insert a target disk, take out the diskette from drive A and insert the blank floppy disk and press return.
  4. Once this process is complete, you will be prompted to write to another duplicate diskette(Y/N). press N.
  5. Then you will be prompted to copy another disk (Y/N). press N.

NOTE: if your machine has two floppy disk drives, insert the original (source) disk into drive A and the blank (target) disk into drive B. then type: DISKCOPY A:B:

For More Info, Watch Video 

Related Links:

 

 

 

 

 

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Check Also

Close
Back to top button
Close