Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Command Prompt Tricks and Tips

Microsoft needs users to move over from Command prompt to PowerShell, however there are sensible reasons to not, the chief one being that PowerShell is a lot of advanced and suited to power users. Command prompt remains the higher choice for everyday users. Learn a lot of in our summary of variations between Command prompt and PowerShell.

But simply because Command prompt is less complicated doesn’t mean it’s primitive. You’ll realize such a large amount of impressive Command prompt tricks and tips which will create your life a lot easier, particularly if you employ the interface on a daily (or even semi-regular) basis. Here are a number of our favorites.

  1. Function Key Shortcuts for Command Prompt

Most of the function keys (F1 through F9) serve a function in the Command Prompt:

F1: Retypes the last used command, character by character per press.

F2: Asks for a character, and then retypes the last used command up to the first occurrence of that character.

F3: Completely retypes the last used command.

F4: Asks for a character, then deletes all characters in the current command, starting from the cursor position up to the first occurrence of the asked character.

F5: Completely retypes previously used commands, but does not cycle.

F6: Types ^Z into the current command.

F7: Presents a menu of previously used commands.

F8: Completely retypes previously used commands, does cycle.

F9: Completely retypes a previously used command, corresponding to the number in the menu presented by F7.

  1. View Command History

When you wish to see each single command you’ve typed since the start of the session, you’ll simply use this command:

doskey /history

Doskey may be a utility provided by Microsoft with many functions, one of which is this history of commands. It’s primarily an equivalent thing as pressing F7, except you’ll save, feed, or manipulate the Output elsewhere. See Tips #7 to #9 additional down during this article.

  1. Repeat a Previous Command

If you would like to recall a previous command, either to repeat it or modify it, all you’ve got to try and do is press the Up Arrow key. Keep pressing it to cycle commands, beginning with the foremost recent.

This is functionally constant as pressing F8 aside from one difference: Up Arrow places your indicator at the top of the command whereas F8 places your indicator at the beginning of the command.

  1. Run Multiple Commands at Once

Suppose you would like to run a dozen commands in sequence however every command may be a time-intensive task. You don’t need to take a seat at your pc and anticipate each to complete with great care you’ll be able to sort within the next command, do you?

Instead, chain multiple commands along victimization &&:

cd C: && echo i am here!

The commands are run within the order you entered them, ranging from the left and moving to the proper, and commands aren’t dead till the previous one finishes.

  1. Cancel a Running Command

If you ever type command and it takes plenty longer to complete than you expect, you’ll be able to simply press Ctrl + C to cancel and stop quickly. This also comes in handy once you run an always-on program and want to finish it.

  1. View Command Output, Page by Page

Most Windows commands produce output to the screen, however typically they produce plenty of output to the screen — most so it instantly scrolls off the screen and disappears, even if you are trying to scroll up! Here’s what you’ll be able to do:

[command with output] | more

Paginated electronic communication output

The additional command displays the output like normal, however it stops once the screen fills. At that time, you’ll be able to press area to continue the output by another page; otherwise you will press Enter to continue the output by single line.

  1. Filter the Output of a Command

If the output of a command is windy and you would like to search out a selected line or instance of a word, you’ll filter the output like so:

[Command with output] | find “query”

Filtered prompt output

For example, suppose you run a diagnostic utility that prints out all of the system errors accumulated over the past year. If you simply wish to slim it all the way down to a particular variety of error, you may filter the output by querying for it.

The find filter applies on a line by line basis, thus it’ll come back all lines that embrace the question text.

  1. Copy the Output of a Command

Let’s say you would like facilitate troubleshooting a problem and Mr. Windows Wiz asks you to run a specific command and copy/paste the results to him. With however particular the prompt may be, merely light and repeating may be a pain within the neck. Instead, do this:

[Command with output] | clip

This feeds the command output on to your writing board. Currently you’ll simply Ctrl + V it where you wish. This can write your clipboard’s current contents, thus be careful!

  1. Save the Output of a Command

If your intention is to avoid wasting the output of a command to a file, you may use the clip methodology above… otherwise you could skip the center step and send it on to a file:

[Command with output] > name.txt

This creates a file named name.txt within the current location of the Command Prompt, and then pastes all of the output within, then saves. If the file already exists, it’ll write everything. If you would like to avoid wasting it elsewhere, sort the complete path (e.g. C:\folder\filename.txt).

Don’t need to overwrite? You’ll instead append the output to the tip of Associate in Nursing existing file:

[Command with output] >> existingfile.txt

  1. View the Structure of Any Folder

If you wish to visualize the layout and structure of a folder that has heaps of files and subfolders, use the tree command. It’s very simple to use and simple to know, and it will be custom-made with parameters to tweak the visualization:

It shows the structure of this folder, however you’ll be able to read the structure of another folder by writing its full path as a parameter. By default, the command solely shows folders, however you’ll be able to additionally read files by adding the tree /F parameter.

For massive folders, you’ll wish to output to a file for easier viewing.

The post Command Prompt Tricks and Tips appeared first on Satvat Blog.

Share the post

Command Prompt Tricks and Tips

×

Subscribe to Online Examination Services, Recruitment Process Outsourcing, Erp, Web Design And Development, Onlin

Get updates delivered right to your inbox!

Thank you for your subscription

×