A beginners guide to the Command Prompt
Most Windows users donâ€™t know what the Command Prompt is or how to use it. This is a beginners guide to using the Command Prompt.
What is the Command Prompt? The Command Prompt is a native Windows program that lets you execute commands without using a GUI. You can accomplish pretty much every task you can do using Windows and the mouse from within the Command Prompt. The Command Prompt gets its roots (arguably) from a combination of MS-DOS and UNIX. Consider it â€œWindows without the windows. â€ I will provide you with a beginners tutorial of some simple commands to familiarize you with the Command Prompt.
The first step is to actually open the ...view middle of the document...
â€œCPâ€ stands for copy and it can be used to copy individual files from one location to another. To copy a file, type copy filename destination. So if you had a file named test.txt in your My Documents folder and you wanted to copy it to the Desktop you would type copy test.txt ../Desktop
The del command stands for delete. So to delete the test.txt file from your desktop type cd ../Desktop and then type del test.txt
â€œmkdirâ€ stands for make directory. To make a new folder type mkdir foldername
â€œrmdirâ€ stands for remove directory. To remove a folder and its contents, type rmdir /s foldername
â€œrenâ€ stands for rename. To rename a file type ren oldfilename newfilename
Letâ€™s move on to a more difficult task. Letâ€™s copy our My Videos folder from My Documents to the Desktop. To do this, navigate to your username directory by typing cd .. until you get there. Now type cd My Documents to get into the My Documents directory. To copy the My Videos directory to the Desktop you need to type xcopy â€œMy Videosâ€ â€œ../Desktop/My Videosâ€ /s /i
Hereâ€™s a summary of what you can now do using the command prompt:
cd change directories
dir see a list of all the files in one directory
copy copy a file from one location to another (donâ€™t forget to include the file extension)
del delete a file (donâ€™t forget to include the file extension)
mkdir make a new folder
rmdir remove a directory and itsâ€™ contents
ren rename a file
xcopy /s /i copy a directory and its contents from one location to another
NOTE: To see a list of many commands, just type help into the command prompt. To see a detailed list of all related commands type command/? so to see all the details of xcopy type xcopy/? If you would like to run an executable like Mozilla Firefox navigate to the directory containing the executable and simply type it in. So type: C:/Program Files/Mozilla Firefox/firefox.exe
If you would like to learn more about the command prompt here is the documentation from Microsoft. What other commands do you think are useful for beginners? Tell your side in the comments.
Read more: Windows, Productivity
Trackbacks & Pings
1. The Better Geek Â» Command Line for the Queasy on 01 Feb 2007 at 11:17 pm
[â€¦] A Beginners Guide to Command Prompt [CodeJacked] [â€¦]
1. naved wrote:
i like the guide. i was trying to learn command prompt from so many days now i have a good guide. thanks
Posted 22 Apr 2007 at 4:50 am Â¶
2. Luis Duarte wrote:
Thank you so much.
Best guide that I found to Command Prompt.
Really nice job.
Many thanks once more.
Posted 26 Apr 2007 at 3:28 pm Â¶
3. marmelo wrote:
Your guide is very good indeed, but I have a doubtâ€¦ I have to run several instances of an application in a Windows server 2003. Each instance of this application should run by launching a batch command file and thus a â€œcommand promptâ€ window stays open. I would like to identify each â€œcommand promptâ€...