Use of dos commands | Command prompt in dos | Go my class
- Go My Class
- Aug 3, 2021
- 4 min read
Updated: Dec 10, 2021
Command prompt
When DOS starts, something like this is displayed on the left side of the screen (C:\>_). This is known as the Command prompt. It indicates where the next dos command begins. The DOS prompt indicates your current drive and directory.
C ~ Denote the present disk drive
: ~ Sub Directory
\ ~ Root Directory
> ~ Command Line
_ ~ Cursor
Note:~ To change the drive, you simply type the drive letter followed by a (:) colon and hit the Enter key.
Dos Command
The order should be entered in accordance with the following rule.
<Command><Parameter>[Switch]
Command
The task you want to be done by DOS. The command should be recognized by DOS.
Parameters
Some additional information is required with commands that tell DOS what or how to do the command.
switch
The switch begins with a front slash (/) and is followed by a letter or a number.
Use of Dos Command
Directory :~ To organize your files, DOS keeps track of each file it contains, while maintaining a list files on the disk. This is called a directory. A directory listing refers to a collection of files residing on disk.
1. MD (Make Directory):- This Command is used to create a new directory.
Syntax :~ C:\>md (Directory Name) (Press Enter)
2. CD (Change Directory) :~ This command is used to move from one directory to another.
Syntax :~ C:\>cd (Present directory name) (Another Directory name) (Press Enter)
3. CD.. Command :~ This command is used to exit from sub directory and directory one by one.
Syntax:~ C:\>cd.. (Press Enter)
4. CD\ Command :~ This command is used to exit from sub directory and directory at a time.
Syntax :~ C:\>cd\ (Press Enter)
5. RD Command :~ This command is use to remove the sub directory and directory one by one.
Syntax :~ C:\>rd (Press Enter)
1. CLS Command :~ This command is used to clear the output received on the screen while executing any basic DOS command. It removes all the text from the computer screen and shows a command prompt to the user.
Syntax :~ C:\>cls (Press Enter)
2. Date Command :~ The date command is an internal basic DOS command. Which is used to display or convert the current date system as mm/dd/yy.
Syntax :~ C:\>date (Press Enter)
3. Time Command :~ The time command is used to display or change the current time of the computer system as hh:mm:ss.
Syntax :~ C:\>time (Press Enter)
4. Copy Con Command :~ This is a very important internal DOS command, which is used to create text files.
Syntax :~ C:\>copy con (File name) (Press Enter)
5. Type Command :~ The Type command is used to view text files.
Syntax :~ C:\>type (File name) (Press Enter)
6. Rename Command :~ Rename command is used to change the name of the existing file.
Syntax :~ C:\> rename (Old file name) (New file name) (Press enter)
7. Copy Command :~ copy command is a basic DOS command used to copy files from one place to another.
Syntax :~ C:\> copy (Source file name) (Target file name) (Press enter)
8. Del Command :~ The del command is used to delete a file.
Syntax :~ C:\> del (File name) (Press enter)
9. Vol Command :~ This command is used to view the volume label of a disk drive.
Syntax :~ C:\> vol (Press enter)
10. Ver Command :~ This command is used to see the version of the operating system that you load into the hard disk.
Syntax :~ C:\> ver (Press enter)
Dir Command
This command is used to view files and directories in detail.
Syntax :~ C:\> dir (Press enter)
Use of dir switches in ms dos:~
1. Dir/P :~ This command is used to display the file and directory in page wise.
Syntax :~ C:\> dir/p (Press enter)
2. Dir/L:~ This command is used to display the file and directory in lower case.
Syntax :~ C:\> dir/l (Press enter)
3. Dir/W :~ This command is used to display the file and directory in wide case.
Syntax :~ C:\> dir/w (Press enter)
4. Dir/S :~ This command is used to display the directory and sub-directory present in your disk.
Syntax :~ C:\> dir/s (Press enter)
5. Dir/B :~ This command is used to display only the files present in your disk.
Syntax :~ C:\> dir/b (Press enter)
6. Dir/AD :~ This command is used to display only the directory present in your disk.
Syntax :~ C:\> dir/ab (Press enter)
7. Dir/AR :~ This command is used to display only the read only file present in your disk.
Syntax :~ C:\> dir/ar (Press enter)
8. Dir/AH :~ This command is used to display only the hidden file present in your disk.
Syntax :~ C:\> dir/ah (Press enter)
9. Dir/AS :~ This command is used to display only the system file present in your disk.
Syntax :~ C:\> dir/as (Press enter)
10. Dir/ON :~ This command is used to display the file and directory by name (alphabetic) present in your disk.
Syntax :~ C:\> dir/on (Press enter)
11. Dir/OE :~ This command is used to display the file and directory by extension present in your disk.
Syntax :~ C:\> dir/oe (Press enter)
12. Dir/OG :~ This command is used to display the Group file and directory by first present in your disk.
Syntax :~ C:\> dir/og (Press enter)
13. DIR/OS:~ This command is used to display the file and directory by size present in your disk.
Syntax :~ C:\> dir/os (Press enter)
14. Dir/OD :~ This command is used to display the file and directory by date and time present in your disk.
Syntax :~ C:\> dir/od (Press enter)
External command
1. Label command:~ This command is used to view, change and delete the volume label.
Syntax :~ C:\> label (Press enter)
2. Sort Command :~ This command is used to arrange the contents of the file in ascending and descending order.
To Ascending Order
Syntax :~ C:\>sort (Filename) (Press enter)
To Descending Order
Syntax:~ C:\>sort /r (Filename) (Press enter)
3. FC Command :~ This command is used to view two file contents at a time.
Syntax:~ C:\>fc (First file name) (Second file name) (Press enter)
4. Type CON>> Command :~Using this command you can add new content or matter to the existing file or save it in dos prompt.
Syntax :~ C:\>con>> type (File name) (Press enter)
5. CHK DSK Command:~ This command is used to check the status and fix minor disk problems.
Syntax:~ C:\> chk dsk (Press enter)
6. Help Command:~ This command is used to help on any other command.
Syntax :~ C:\>help (Command name) (Press enter)
7. Color Command :~ This command is used to change the background and foreground color.
Syntax :~ C:\>color t (Press enter)
[The color list will appear on your screen.]
Example:~ C:\>color 2 (Press enter)
To change the background color to red and the foreground to white.
Example:~ C:\>color 47 (Press enter)
Comments