Sat 20 April 2024
Baydari.com

Create a File with DOS

Types

  1. Type: copy can Ham and press Enter.
  2. Type this message in the following format: IT Series Quality Books for Students.
  3. Press Ctrl +Z and press return.
  4. DOS gives you a message that 1 File(s) has copied.
  5. Type: dir I* and press return.
  6. 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.text info2.txt and press return.
  2. DOS will tell you one file has been copied.
  3. Type: dir q* and press return.
  4. You should have two files listed with different names.

Note: File names 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.It and press return.

2. DOS prints the contents of the file.

 

Rename a File

The RENAME command leis you rename a previous file with a new name.

  1. Type: ren inf02.txt detail.txt and press return.
  2. Type: dir* text 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

DOS has 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. Type: dir \info and press return.
  3. Notice that a copy of Sales.txt is copied into the subdirectory Info. The original file is also in the root directory.

 

Copy a Group of Files into a Subdirectory

When copying a group of files from the root directory into a subdirectory, it is necessary to use the wildcard character along with the COPY command.

  1. Type: copy quick.* \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. Salesbob 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 foot directory. It will destroy all DOS files that are necessary to boot and operate the computer.

  1. Type: Ed \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? (YIN)
  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: rd \info and press return.
  4. Type: dir *. and press return.
  5. Notice that the Info subdirectory is no longer listed.

Share