Wednesday, January 2, 2008

I.T. - Command Prompt for Dummies

Topic : Command Prompt

Objectives : Enter Directory Command
- Scroll through directory listings
- Change drives using commands
- Create directories
- Create files
- Copy files
- Rename Files
- Delete

TUTORIAL

The command prompt program allows you to work in an environment that looks more like a traditional operating system as opposed to the icon based Windows environment. In Command Prompt you will use your everyday keyboard. Command Prompt works at a lower level than windows. This means that you will have more control over the machine. The disadantage is that it is less user friendly.

1.1. Opening a Command Prompt
There are two main ways :
1. Start Menu
2. Start -> Run -> type “cmd” [enter]

NB : To maximize : alt + enter, to exit, type “exit” [enter], to clear scree type “cls” [enter]

1.2 DOS Commands
The “dir” command is probably the most basic command. It gives you a listing of all the files and folders located in the directory you are in.

1.3. Task A
“cd” (change directory) this changes the directory relevant to the one you are currently working

1. Type “dir” [enter]
2. Number of directories listed? ____
3. What is the location/ path?
4. Type “cd my documents” [enter]
5. Type “dir” and press [enter]

1.4 Wild Card
Wildcards act as a substitue for a name or extension. It is symbolized as an asterik [*] , [NB: A space is always put before a wildcard]

Example : C:\>copy A:\ *. * C:\ Student [This copies all the files in the “A” dirve into the subdirectory “Student” on the “C” drive

1. Type dir *.doc [enter]
2. Type dir *.xls [enter]
3. What do you notice? ______________________________________________________________
4. Type dir [enter]

1.5 Moving Back Up (to the root of the drive)
- To do this, type “cd..” [enter]

So :- “C:\Documents and Settings\ Student” would be changed to “C:\Documents and Settings”.

To return to C:\ , type “cd \” [enter]
If you want to access a totally different directory, for example “Program Files” [NB. You must be at C:\ for this to happen]
- Type “cd program files” [enter]

When changing directories, if the directory name is unique, then you can use wild cards. For example : “cd program *”

1.8 Repeat a command
If you want to repeat a command that you have just run, or adjust something in the last command, press the “Up” arrow key to bring it back. You can then adjust it and press [enter].

1.8.2. Make Directories
To make a directory just type “md newfilethatyouwanttocreate”

1.9. Creating Files in Command Prompt
This is a really cool way to create filesfrom command prompt. We will work with : .txt, doc., and .html. Th following “Copy” command copies what you type at the keyboard to the oranges.doc file

A:\ food\ fruits \ vitaminc > copy con oranges.doc Oranges are a great source of Vitamin C. [ctrl-Z] or [F6]

[Ctrl-Z or F6] saves the message you typed. When you type “oranges.doc” [enter] it takes you to the actual word document.

1.11 Rename a file –[Ren]
You can rename a file in command prompt

Ren [OR] Rename [drive:] [path] filename1.extension filename2.extension

This would reanme filename1 to filename2.

1.12 Copy
The copy command will as the name implies, copy files from one place to another.

Copy con whatever.doc [enter]
Type whatever you want in the file [F6]

A:\ food\ fruits \ vitaminc > copy con oranges.doc moreoranges.txt

This copies all files in oranges.doc into moreoranges.txt

1.13 Deleting Files
Remember that if you delete a file within a DOS session, it does not go into the recycle bin. It will be deleted immediately. Remember, the asterick character, * , can stand in for any number of characters.

Del *.doc [enter] <- This command will delete every file with the .doc extension from the root directory. (Drive a:\)

Type dir [enter] to see all the remaining files

1.17. Full Command Listing
If you want a full list of the commands available to you, just type “help” and they will be listed. You can then type “help” ” for the instructions

HELPFUL WEBSITE : http://www. Pcnet-online.com/index.html
HELPFUL PAGE : Page 21