IMPORTANT THINGS TO KNOW :-
Command Prompt is a command line interpreter application available in most Windows operating systems.
Command Prompt is officially called Windows Command Processor but is also sometimes called the command shell or by its file name cmd.exe
Note:
Command Prompt is sometimes incorrectly referred to as "the DOS prompt" or as MS-DOS itself. Command Prompt is a Windows program that emulates many of the command line abilities available in MS-DOS but it is not actually MS-DOS.
Below are the top basic command prompt tricks for windows 7.
If you haven't actually executed a command, you can just backspace and erase what you've typed, but if you've already executed it then you can do a Ctrl-C to stop it.
Ever run a command, like the dir command, that produces so much information on the screen that it's almost useless? You're not alone.
One way around this is to execute the command in a special way so whatever information is generated is shown to you one page, or one line, at a time.
To do this, just type the command, the dir command for example, and then follow it with the pipe redirection operator and then the more command.
For example, executing dir /s | more will generate the thousands of lines of results that you expect from the dir command, but the more command will pause each page of results with -- More -- at the bottom of the page, indicating that the command is not done running.
Just press the space bar to advance by page or press the Enter key to advance one line at a time.
Many commands require that you execute them from an elevated Command Prompt in Windows - in other words, execute them from a Command Prompt that's run as an administrator.
You can always right-click on any Command Prompt shortcut and choose Run as administrator but creating a shortcut to do the same thing can be a huge time saver if you're a frequent Command Prompt power user.
To complete this Command Prompt trick, just create a Command Prompt shortcut on the desktop, enter the shortcut's properties and then select the Run as administrator box located in the Advanced button on the Shortcut tab.
The fact that the function keys actually do something in the Command Prompt is maybe one of the best kept secrets about the tool:
F1: Pastes the last executed command (character by character)
F2: Pastes the last executed command (up to the entered character)
F3: Pastes the last executed command
F4: Deletes current prompt text up to the entered character
F5: Pastes recently executed commands (does not cycle)
F6: Pastes ^Z to the prompt
F7: Displays a selectable list of previously executed commands
F8: Pastes recently executed commands (cycles)
F9: Asks for the number of the command from the F7 list to paste
Did you know that the prompt itself in the Command Prompt is completely customizable thanks to the prompt command? It is, and when I say customizable, I mean really customizable.
Instead of C:\>, you can set the prompt to any text you want, have it include the time, the current drive, the Windows version number, you name it.
One useful example is prompt $m$p$g which will show the full path of a mapped drive in the prompt, alongside the drive letter.
You can always execute prompt alone, without options, to return it to its sometimes boring default.
Believe it or not, the help command does not provide help for every Command Prompt command. However, any command can be suffixed with the /? option, usually called the help switch, to display detailed information about the command's syntax and often times even some examples.
I doubt that the help switch is the coolest Command Prompt trick you've ever heard of, but it's hard to disagree that it's one of the more useful.
Unfortunately, neither the help command nor the help switch offer much in the way of explaining how to interpret the syntax.
An incredibly useful Command Prompt trick is the use of redirection operators, specifically the > and >> operators.
These little characters let you redirect the output of a command to a file, giving you a saved version of whatever data the command produced in the Command Prompt window.
For example, let's say you're about to post a computer problem to an online forum and you want to provide really accurate information about your computer. An easy way to do that would be to use the systeminfo command with a redirection operator.
For example, you might execute systeminfo > c:\mycomputerinfo.txt to save the information provided by the systeminfo command to a file. You could then attach the file to your forum post.
I think one of the neatest little commands is the tree command. With tree, you can create a kind of map of the directories on any of your computer's drives.
Execute tree from any directory to see the folder structure under that directory.
Tip: With so much information, it's probably a good idea to export the results of the tree command to a file. For example, tree /a > c:\treeresults.txt
Tired of that Command Prompt title bar text? No problem, just use the title command to change it to whatever you like.
For example, let's say your name is Maria Smith, and you want to express your ownership of the Command Prompt: execute title Property of Maria Smith and the Command Prompt's title bar will change immediately.
The change won't stick, so the next time you open Command Prompt the title bar will be back to normal.
The title command is usually used to help give a custom appearance in script files and batch files... not that I'm saying titling it with your name isn't a good idea!
If you've ever worked in the Command Prompt for very long, you know that it can be really frustrating executing the cd/chdir command over and over again to get to the right directory you want to work from.
Luckily, there's a super easy Command Prompt trick that will let you open a Command Prompt window from whatever folder you're viewing in Windows.
All you have to do is navigate, in Windows, to the folder you want to start working from in the Command Prompt. Once there, hold down your Shift key while you right-click anywhere in the folder. Once the menu pops up, you'll notice an entry that's not usually there: Open command window here.
Click it and you'll start a new instance of the Command Prompt, ready and waiting at the right location!
If you're a Command Prompt power user, you'll immediately recognize the value in this little trick.
Yes, you read that correctly, you can watch an ASCII version of the full Star Wars Episode IV movie right in the Command Prompt window!
Just open Command Prompt and execute telnet towel.blinkenlights.nl. The movie will start immediately. This isn't a terribly productive use of the Command Prompt, nor is it really a trick of the Command Prompt or any command, but it sure is fun!
Note: The telnet command is not enabled by default in Windows 7 or Windows Vista but can be turned on by enabling Telnet Client from Windows Features in the Programs and Features applet in Control Panel. If you'd rather not enable Telnet but would like to see the movie, you can also watch it in your browser here.
Like to know the IP address of a website? There are a few different commands you can use to find it.
Let's use the nslookup command to find the IP address of About.com. Just execute nslookup about.com and view the result. Make sure you don't confuse any private IP addresses that also show up in the nslookup results alongside About.com's public IP address.
Another way to find a site's IP address is to use the ping command. Execute ping about.com and then look at the IP address between the brackets in the results shown.
Using either Command Prompt trick, the result is 207.241.148.80.
Tab completion is another Command Prompt trick that can save you lots of time, especially if your command has a file or folder name in it that you're not completely sure of.
To use tab completion in the Command Prompt, just enter the command and then the portion of the path that you do know, if at all. Then press the tab key over and over to cycle through all of the available possibilities.
For example, let's say you want to change directories to some folder in the Windows directory but you're not sure what it's named. Type cd c:\windows\ and then press tab until you see the folder you're looking for. The results cycle or you can use Shift+Tab to step through the results in reverse.
Another great Command Prompt trick has to be the use of the keyboard arrow keys to cycle through previously executed commands. The up and down arrow keys cycle through the commands you've entered and the right arrow automatically enters, character by character, the last command you executed.
This might not sound that interesting, but there are several situations where the arrow keys become huge time savers.
Consider this example: You've typed out 75 characters of a command and then try to execute it, only to find that you forgot to add an option at the very end. No problem, just hit the up arrow and the entire command is automatically entered in the Command Prompt window, ready for you to edit to make it work.
these are some common but cool command prompt tricks and hacks that you should know.
please like, share and comment if the article was helpful for you.
Command Prompt is a command line interpreter application available in most Windows operating systems.
Command Prompt is officially called Windows Command Processor but is also sometimes called the command shell or by its file name cmd.exe
Note:
Command Prompt is sometimes incorrectly referred to as "the DOS prompt" or as MS-DOS itself. Command Prompt is a Windows program that emulates many of the command line abilities available in MS-DOS but it is not actually MS-DOS.
Below are the top basic command prompt tricks for windows 7.
1. Use Ctrl-C to Abort a Command
Just about any command can be stopped in its tracks with the abort command: Ctrl-C.If you haven't actually executed a command, you can just backspace and erase what you've typed, but if you've already executed it then you can do a Ctrl-C to stop it.
NOTE: Ctrl-C isn't a magic wand and it can't undo things that aren't undoable, like a partially complete format command. However, for things like the dir command that seem to go on forever or questions you're asked at the prompt that you don't know the answer to, the abort command is an excellent Command Prompt trick to know.
2. View a Command's Results One Page (or Line) at a Time
Ever run a command, like the dir command, that produces so much information on the screen that it's almost useless? You're not alone.
One way around this is to execute the command in a special way so whatever information is generated is shown to you one page, or one line, at a time.
To do this, just type the command, the dir command for example, and then follow it with the pipe redirection operator and then the more command.
For example, executing dir /s | more will generate the thousands of lines of results that you expect from the dir command, but the more command will pause each page of results with -- More -- at the bottom of the page, indicating that the command is not done running.
Just press the space bar to advance by page or press the Enter key to advance one line at a time.
3. Run Command Prompt as an Administrator Automatically
Command Prompt Admin Shortcut - Command Prompt TricksMany commands require that you execute them from an elevated Command Prompt in Windows - in other words, execute them from a Command Prompt that's run as an administrator.
You can always right-click on any Command Prompt shortcut and choose Run as administrator but creating a shortcut to do the same thing can be a huge time saver if you're a frequent Command Prompt power user.
To complete this Command Prompt trick, just create a Command Prompt shortcut on the desktop, enter the shortcut's properties and then select the Run as administrator box located in the Advanced button on the Shortcut tab.
4. Become a Command Prompt Power User with Function Keys
Command Prompt Function Keys - Command Prompt TricksThe fact that the function keys actually do something in the Command Prompt is maybe one of the best kept secrets about the tool:
F1: Pastes the last executed command (character by character)
F2: Pastes the last executed command (up to the entered character)
F3: Pastes the last executed command
F4: Deletes current prompt text up to the entered character
F5: Pastes recently executed commands (does not cycle)
F6: Pastes ^Z to the prompt
F7: Displays a selectable list of previously executed commands
F8: Pastes recently executed commands (cycles)
F9: Asks for the number of the command from the F7 list to paste
5. Hack the Prompt Text
Prompt Command - Command Prompt TricksDid you know that the prompt itself in the Command Prompt is completely customizable thanks to the prompt command? It is, and when I say customizable, I mean really customizable.
Instead of C:\>, you can set the prompt to any text you want, have it include the time, the current drive, the Windows version number, you name it.
One useful example is prompt $m$p$g which will show the full path of a mapped drive in the prompt, alongside the drive letter.
You can always execute prompt alone, without options, to return it to its sometimes boring default.
6. Get Help for Any Command
Help Switch - Command Prompt TricksBelieve it or not, the help command does not provide help for every Command Prompt command. However, any command can be suffixed with the /? option, usually called the help switch, to display detailed information about the command's syntax and often times even some examples.
I doubt that the help switch is the coolest Command Prompt trick you've ever heard of, but it's hard to disagree that it's one of the more useful.
Unfortunately, neither the help command nor the help switch offer much in the way of explaining how to interpret the syntax.
7. Save a Command's Output to a File
Command Output - Command Prompt TricksAn incredibly useful Command Prompt trick is the use of redirection operators, specifically the > and >> operators.
These little characters let you redirect the output of a command to a file, giving you a saved version of whatever data the command produced in the Command Prompt window.
For example, let's say you're about to post a computer problem to an online forum and you want to provide really accurate information about your computer. An easy way to do that would be to use the systeminfo command with a redirection operator.
For example, you might execute systeminfo > c:\mycomputerinfo.txt to save the information provided by the systeminfo command to a file. You could then attach the file to your forum post.
8. View a Drive's Entire Directory Structure
Directory Structure with Tree Command - Command Prompt TricksI think one of the neatest little commands is the tree command. With tree, you can create a kind of map of the directories on any of your computer's drives.
Execute tree from any directory to see the folder structure under that directory.
Tip: With so much information, it's probably a good idea to export the results of the tree command to a file. For example, tree /a > c:\treeresults.txt
9. Customize the Command Prompt Title Bar Text
Command Prompt Title Bar - Command Prompt TricksTired of that Command Prompt title bar text? No problem, just use the title command to change it to whatever you like.
For example, let's say your name is Maria Smith, and you want to express your ownership of the Command Prompt: execute title Property of Maria Smith and the Command Prompt's title bar will change immediately.
The change won't stick, so the next time you open Command Prompt the title bar will be back to normal.
The title command is usually used to help give a custom appearance in script files and batch files... not that I'm saying titling it with your name isn't a good idea!
10.Open the Command Prompt From Any Location
If you've ever worked in the Command Prompt for very long, you know that it can be really frustrating executing the cd/chdir command over and over again to get to the right directory you want to work from.
Luckily, there's a super easy Command Prompt trick that will let you open a Command Prompt window from whatever folder you're viewing in Windows.
All you have to do is navigate, in Windows, to the folder you want to start working from in the Command Prompt. Once there, hold down your Shift key while you right-click anywhere in the folder. Once the menu pops up, you'll notice an entry that's not usually there: Open command window here.
Click it and you'll start a new instance of the Command Prompt, ready and waiting at the right location!
If you're a Command Prompt power user, you'll immediately recognize the value in this little trick.
11. Watch Star Wars Episode IV
ASCII Star Wars - Command Prompt TricksYes, you read that correctly, you can watch an ASCII version of the full Star Wars Episode IV movie right in the Command Prompt window!
Just open Command Prompt and execute telnet towel.blinkenlights.nl. The movie will start immediately. This isn't a terribly productive use of the Command Prompt, nor is it really a trick of the Command Prompt or any command, but it sure is fun!
Note: The telnet command is not enabled by default in Windows 7 or Windows Vista but can be turned on by enabling Telnet Client from Windows Features in the Programs and Features applet in Control Panel. If you'd rather not enable Telnet but would like to see the movie, you can also watch it in your browser here.
12. Find a Website's IP Address
Website IP Address - Command Prompt TricksLike to know the IP address of a website? There are a few different commands you can use to find it.
Let's use the nslookup command to find the IP address of About.com. Just execute nslookup about.com and view the result. Make sure you don't confuse any private IP addresses that also show up in the nslookup results alongside About.com's public IP address.
Another way to find a site's IP address is to use the ping command. Execute ping about.com and then look at the IP address between the brackets in the results shown.
Using either Command Prompt trick, the result is 207.241.148.80.
13. Automatically Complete Commands with Tab Completion
Tab Completion - Command Prompt TricksTab completion is another Command Prompt trick that can save you lots of time, especially if your command has a file or folder name in it that you're not completely sure of.
To use tab completion in the Command Prompt, just enter the command and then the portion of the path that you do know, if at all. Then press the tab key over and over to cycle through all of the available possibilities.
For example, let's say you want to change directories to some folder in the Windows directory but you're not sure what it's named. Type cd c:\windows\ and then press tab until you see the folder you're looking for. The results cycle or you can use Shift+Tab to step through the results in reverse.
14. Access Previously Used Command with the Arrow Keys
Arrow Keys - Command Prompt TricksAnother great Command Prompt trick has to be the use of the keyboard arrow keys to cycle through previously executed commands. The up and down arrow keys cycle through the commands you've entered and the right arrow automatically enters, character by character, the last command you executed.
This might not sound that interesting, but there are several situations where the arrow keys become huge time savers.
Consider this example: You've typed out 75 characters of a command and then try to execute it, only to find that you forgot to add an option at the very end. No problem, just hit the up arrow and the entire command is automatically entered in the Command Prompt window, ready for you to edit to make it work.
these are some common but cool command prompt tricks and hacks that you should know.
please like, share and comment if the article was helpful for you.
0 comments:
Post a Comment