DCA
Important Links
What is CMD?
A command prompt is used in a text-based or "command-line" interface, such as a Unix terminal or a DOS shell. It is a symbol or series of characters at the beginning of a line that indicates the system is ready to receive input. It other words, it prompts the user for a command
The command prompt is often preceded by the current directory of the system the user is working with. For example, the default prompt in DOS may be C:\, which indicates the user is working at the root level of the main C: drive.
A user can type commands at the command prompt, such as cd /, which means "change directory to the root folder." The "cd" command allows the user to browse through different directories of files on a hard disk or network. There are dozens of other commands that a user can type, which can be used to list, move, delete, and copy files, run programs, or perform other operations.
How to open CMD?
To use the command prompt you would type in the commands and instructions you want and then press enter.
Important command :-
cd
The cd command is used to change the current working directory in operating systems such as Unix, DOS. it is also known as chdir (change directory).
C:\Users\hp>cd/ :- it change the root directory.
C:\
C:\Users\hp>cd.. :- it change the single directory.
C:\Users\cd.. :- The double dotted means that we will go into the parent directory "c".
C:\
C:\Users>cd ..\hp
C:\hp>
The . stands for the current directory and the .. stands for the previous directory in the path.
C:\cd Users :- it change the root directory to Users directory.
C:\Users\
C:\Users\cd hp
C:\Users\hp\
dir command :-
DIR command show the folders and files in command prompt. DIR is the MS DOS version of LS, which lists the files and folders in the current directory. Here is a huge list of all the Linux terminal commands and their Windows equivalents.
This command will list the files and directories contained in your current directory, if used without an argument, or the directory you specify as an argument. To use the command you would just type dir and press enter and you will see a listing of the current files in the directory you are in, including information about their file sizes, date and time they were last written to. The command will also show how much space the files in the directory are using and the total amount of free disk space available on the current hard drive. If I typed dir \test I would see the contents of the c:\test directory
you can use the * symbol which stands for wildcard. With this in mind, typing dir *.txt will only list those files that end with .txt.
This command will list the files and directories contained in your current directory, if used without an argument, or the directory you specify as an argument. To use the command you would just type dir and press enter and you will see a listing of the current files in the directory you are in, including information about their file sizes, date and time they were last written to. The command will also show how much space the files in the directory are using and the total amount of free disk space available on the current hard drive. If I typed dir \test I would see the contents of the c:\test directory
you can use the * symbol which stands for wildcard. With this in mind, typing dir *.txt will only list those files that end with .txt.
C:\dir :- it show the all directory of c drive.
C:\dir/test :- it show the all directory of test directory.
cls
cls command is used for clear the screen.
C:\cls
type command
display the contents of the text file.
To view the text contents in mytext.txt you can use "type mytext.txt". If you want to edit the text, You can use "write mytext.txt" to edit using Wordpad.
For editing the text in Windows XP, You can type "edit mytext.txt".
To view the text contents in mytext.txt you can use "type mytext.txt". If you want to edit the text, You can use "write mytext.txt" to edit using Wordpad.
For editing the text in Windows XP, You can type "edit mytext.txt".
C:\type mytext.txt
C:\write mytext.txt
color command:-
You can change the color of the text and the background. You start off with a gray-ish text and a black background. Type in "color help" for a full list of all the combinations you can make.
A fun combo is "color FC" which provides with red text on a white background.
"Color 0a" uses bright green on black, which may seem drab, but is actually a cool hacker look.
title command:-
if desired. If you were to look at the top of the CMD window, you would notice it would say: C:\Windows\system32\cmd.exe. A bit boring, isn't it? Type "title" followed by whichever text you wish to be there instead. For example, "title mahtab!"
c:\title mahtab
tree command:-
Graphically displays the directory structure of a drive or
path.
Copy command :-
This command allows you to copy files from one location to another.
copy filetocopy copiedfile. For example if you have the file c:\test\test.txt and would like to copy it to c:\windows\test.txt you would type copy c:\test\test.txt c:\windows\test.txt and press enter. If the copy is successful it will tell you so and give you back the prompt. If you are copying within the same directory you do not have to use the path. Here are some examples and what they would do:
copy test.txt test.bak Copies the test.txt file to a new file called test.bak in the same directory
copy test.txt \windows Copies the test.txt file to the \windows directory.
copy * \windows Copies all the files in the current directory to the \windows directory.
copy filetocopy copiedfile. For example if you have the file c:\test\test.txt and would like to copy it to c:\windows\test.txt you would type copy c:\test\test.txt c:\windows\test.txt and press enter. If the copy is successful it will tell you so and give you back the prompt. If you are copying within the same directory you do not have to use the path. Here are some examples and what they would do:
copy test.txt test.bak Copies the test.txt file to a new file called test.bak in the same directory
copy test.txt \windows Copies the test.txt file to the \windows directory.
copy * \windows Copies all the files in the current directory to the \windows directory.
copy sourceFile destinationFile
Example: To copy a file from c:\data\file1.doc to D:\backup\file2.doc
copy c:\data\file1.doc D:\backup\file2.doc
If the destination file already exists you will be prompted for confirmation. To suppress this confirmation you can use /Y switch with copy command. This would be useful if you are executing copy command from a batch file.
c\> copy /Y c:\dir1\subdir1\file1.txt c:\dir2\subdir2\file2.txt
If the destination file exists, the above command will overwrite the same without asking the user for confirmation.
Copy file to another directory :-
When we specify a directory path as the destination, the files will be copied with the same name. We can assign a different name by specifying the new name in the destination path.
c\> copy c:\data\documents\1.doc c:\data\newdocs\
c\> copy c:\data\documents\1.doc c:\data\newdocs\
chkdsk :-
Checks filesystem and repairs filesystem corruption on hard drives.
date and time :-
Date on Unix prints the current date and time. Date and time on Windows print the date and time respectively, and prompt for a new date or time.
del :-
doskey /h :-
edit :-
edit brings up a simple text editor in Windows. On Unix, the environment variable EDITOR should be set to the user’s preferred editor.
exit :-
n Unix, pressing the control key and D simultaneously logs the user out of the shell.
explorer :-
The command explorer brings up the file browser on Windows.
help :-
“help” by itself prints all the commands
mkdir
help :-
“help” by itself prints all the commands
:-
:-
:-
C:\Users\hp>net user USERNAME