Você está na página 1de 4

DOS commands are divided into 2 type.

1. Internal Commands

2. External Commands

Internal Commands

These commands are apply on the existing files or within the system only.
Syntax: How to execute a command without any error is called syntax.
CLS: This command is used to clear the Screen.
Syntax: Cls
Example: Cls <-'
user.

Date: It is used to display the current system date and also it accepts new date from the

Syntax:
date [mm-dd-yy]
Example: date <-'
Example: date 08-12-2004
Time: It is used to display the current system time and also it accepts new time from the
user. The time format is (HH:MI:SE.MSA/P). If you set the new Time that will set up to the system
logout or switch off.
Syntax : Time [HH:MI:SE]
Example : time
Example : time 12:36
Ver: To display the current version of the DOS Operating system.
Syntax : ver
Example : ver
DIR: It is used to display the list of files, directories and its sub directories that in the
current drive or in the Current directory or active directory.
Syntax :
dir [drive:][path] [/p][/w][/l][/s][/b] [[/A:]Attributes]
[[/O]Attributes]]

6. Copy Con: The copy con command is used to create a file.


Syntax: Copy Con [drive:][path]<file_name>
Examples:
1. Create a file without extension
copy con sample (press Enter Key)
This File Name Is Sample
To save the file press F6 function key or Ctrl+Z and then Press Enter Key.
TYPE : The type command is used to display the contents of a specified file.
Syntax: Type [Drive:][Path]<Filename>
Example:
type sample.txt
type h:\dos\sample.txt
type h:\dos\sample1.txt
8. DEL OR ERASE : These commands are used to remove the files from the
disk permanently.
Syntax: Del [drive:][path]<file_name>
Erase [drive:][path]<file_name>
Example: del sample.txt
erase h:\dos\sample.txt
9. MKDIR OR MD :
These both are used to create a directory with the specified name. Without specify the path
then it create a directory in the active directory.
Syntax: MKDIR [drive:][path]<dir_name> or
MD [drive:][path]<dir_name>

CHDIR OR CD :
It is used to change the directory from active directory to specified directory.
Syntax:
CHDIR <dir_name> or CD <dir_name>
Example: cd mydir
11 CD.. :
This command is used to come out from the current dir to parent directory or Previous
Directory.
RM or RMDIR :
To remove a directory permanently from the Disk. To remove a directory using this command that directory must
and should be empty otherwise it show the following error. Directory not Empty.
In that situation first remove files and subdirectories that are present.
Syntax :

RD [drive:][path]<dir_name>

or
RMDIR [drive:][path]<dir_name>
13. Copy :
This command is used to copy one or more files from source to
Syntax:
copy [drive:][path] <Source_file> [drive][path]<target_File>
Wildcard Characters:
There are two types of wild card characters in MS-DOS.
They are
1. * (Asteric)
2. ? (Question Mark)
* - represents group of characters.
? - represents single character

destination.

. Rename or Ren :
This command is used to change the name of the file or files you
specify.
You can rename all files matching the specified filename. You
cannot use the RENAME command to rename files across drives
Syntax : RENAME [drive:][path]filename1 filename2
or
REN [drive:][path]filename1 filename2
Example :
rename original duplicate
rename h:\dos\kk.txt h:\dos\jj.txt

Você também pode gostar