Sunday 29 September 2013

DOS Tutorial Lesson 4

A. Create a Subdirectory.
B. Move to a Subdirectory.
C. Set the DOS Prompt.
D. Move to the Parent Directory.
E. Copy a File into a Subdirectory.
F. Copy a Group of Files into a Subdirectory.
G. List Files in the Root from the Subdirectory.
H. Select the Directory List.
I. List Subdirectories.


Create a Subdirectory

To create a subdirectory, you will need to use the MAKE DIRECTORY command, a.k.a. MD. The MD command is useful for organizing files on your hard drive. With subdirectories, you can create and store related files together. For example, one subdirectory could be used to store all word processing files and another for all spreadsheet files.


Directions:

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

Once you have created a subdirectory, to move to that directory, you will use the CHANGE DIRECTORY command, a.k.a. CD.

Directions:

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


Set the DOS Prompt

You can set or change the standard system prompt to display the name of the directory or subdirectory you are currently working in.

Directions:

1. Type: prompt $p $g and press return.
2. The DOS prompt tells you that you are working in the C directory (drive) and in the Info subdirectory.
3. Type: dir and press return.
4. The single dot stands for the current directory. The double dots stand for the parent directory (root). The dots are often referred to as place markers.


Move to the Parent Directory

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

Directions:

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


Copy a File into a Subdirectory

The COPY command lets you copy files from one directory to another.

Directions:

1. Type: copy sales.bob \info and press return.
2. Type: dir \info and press return.
3. Notice that a copy of Sales.bob 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.

Directions:

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 Files in a Subdirectory

The CHANGE DIRECTORY, a.k.a. CD, command will let you list files in your subdirectory from your hard drive.

Directions:

1. Type: cd \info and press return.
2. Type: dir and press return.
3. All files in the Info subdirectory are listed.
List Files in the Root from a Subdirectory
The DIRECTORY command is also used to get a listing of all the files in the root directory while in a subdirectory. The backslash character \ represents the root directory.

Directions:

1. Type: dir \ and press return.
2. All the files in the root directory are listed.
Select the Directory List
To look for a specific filename extension, you can use the SELECTED DIRECTORY command.

Directions:

1. Type: dir \*.bat and press return.
2. Only the files with the .bat extensions are listed.
3. Press the F3 key.
4. Backspace three times.
5. Type: sys and press return.
6. Now only the files with the .sys extensions are listed.


List Subdirectories

Directions:

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.

No comments:

Post a Comment