DOS commands

Submitted by Karthik on

The dos commands are classified into two types.

 1. Internal commands.

            cls, date , time, dir, copycon , md, cd, rd, copy, path, ren

            del, prompt, vol, type, ver, etc..


2. External commands.

               format,unformat,attrib, chkdsk, backup, restore,fdisk,diskcopy, edit,

               label, scandisk, nove,more, fc, sort, deltree, undelete



Internal  commands

  Built-in the file called So the file works as an interpreter as well as contains all the internal commands.

e.g. Date, Time, Cls, Dir etc....



  •  To display the system date and allows the user to change the system date.
  •   mm-dd-yy(month,date and year in 2 digits)




                        current date is:10-23-11

                        enter new date :


            => To display the system time and allowes the user to change the system time.


The format is

            hh:mm:ss:ms a/p(hours:minutes:seconds:microseconds am/pm)



                        current time is: 7:00:05.50p

                        enter new time:



            To clear the content or text in the screen cls command is used.





            we can display the list of all the files using dir command. dir is nothing to display all the  files and sub-directories.



            dir/p              =>   it will continue with the next set of files after any key is pressed.


            dir/w             =>  it will be display in coloumn wise


            dir/on       ----- the files are sorted according to the name of files,in ascending order


            dir/o-n    ------ desending order


            dir/oe            ---  files are sorted according to the extension of file.


            dir/od            ---  files are sorted according to the date &time of creation.recently created file will come first.


            dir/os---  files are sorted according to the size of file.smallest file will come first


            dir/o-s       -----  files are sorted according to the size of file.largest file will come first


            dir/l   --- file names are displayed in lower case letters.


            dir/b  --- bare output. only file names


            dir/s   --- display all the files and subdirectories recursively.

 Wild card symbols

            * refers muliple character.

            ? refers to a single character.


            dir a*.* ==> display all the files with "a" and can have any extension.

            dir *.txt ==> display all the files with extension .txt.

md:-(make directory)

             we can create subdirectory into the main directory or into some other dirctory.


cd(change directory)

            we can change the current working directory to some other directory.


            c:\>md  projects

            c:\>cd  projects


copy con

            This command is used to create a new file.whetever we have typed into the terminal is copied into the file name we have specified.


                        c:\copy con myfile

                        I want to learn MS DOS


                                    1 file(s) copied



            The type command is used to display all the contents of a file that has been already created


                        c:\projects>type myfile

                        I want to learn MS DOS


            If you want to delete or erase a file we can use delete or erase command.      


                        c:\>del  projects



            We can copy  the text of a file into a carbon copy of a document we can make duplication copy.



                        copy  old file name   new file name


                        c:\copy myfile  newfile



            we can rename the existing file using the rename or ren command.



                        ren  old file name   new file name


                        c:\ren myfile  file1


      You can change the volume label by using 'LABEL' this command.  VOL command displays the current volume name and serial number.


Deleting directory / folder

    To remove a directory, it should be empty.        


              RD[Path]<Directory name>

            example:             c:\rd myfolder