Friday, November 28, 2008

DOS Commands

Dos commands are of two types
1. internal commands
2. 2. external commands
internal commands are those which executes without the help of any file i.e. to executes internal commands there is no need for any external file.
External commands are those which only executes if their associated files are exist.
Example of internal commands are... cls, dir, md, cd, rd, prompt, date, time etc.
Example of external commands are.. attrib, tree, format, xcopy etc..
DIR: dir commands is used to display files and directories.
There are various switches to execute dir commands.. these are..
Dir/p : to display files and directories page wise
Dir/w to display files and directories width wise
Dir/on to display files and directories in a sorted manner (name wise)
Dir/os to display files and directories in a sorted manner(size wise)
Dir/s to search a file or directory.

CLS : this command is used to clear the screen..

PROMPT: this command is used to change the prompt. The syntax is
Prompt
e.g. prompt blsim
prompt $p: to display path with prompt
prompt $g: to display '>' sign with prompt

MD: to create a directory. The syntax is
Md
e.g. md blsim
CD: to change the directory. The syntax is
Cd
e.g. cd blsim
RD: to remove a directory
The syntax is
Rd
e.g. rd blsm
DATE: to set the system date
Time to set the system time
DEL to delete a file
Syntax is
Del xyz where xyz is a file.
Copy it is used to copy a file from source location to destination
Syntax is
Copy
Move is is used to move a file from source location to destination
Syntax is
Move
External Commands

Chkdsk it is used to check the disk for error.
Syntax is
Chkdsk

Tree it is used to display the directory structure in a hierachical manner..
Syntax is
Tree
Attrib it is used to give some attribute (read only, hide) to a file or directory
Attrib +r to make a file read only
Attrib +h to make a file hidden
Attrib -r to remove the read only attribute of a file
Attrib -h to remove a hidden attribute of a file
Format to format a disk drive
Format/q to perform a quick format (faster than normal format)
Format/s format and install basic operating system files in a drive.

Doskey: it is used to store the command history. One can see the commands which are executed earlier and can access them by pressing up arrow key.
Syntax is
Doskey.

posted by - Ujjwal

No comments: