Download and install the Powershell 2.0 console (if you are using Windows 7, it is already installed).
It supports all the legacy commands as well as alias, macros and more...
Here are some basic tips.
get-history:
Displays a list of previously entered commands.
invoke-history 35:
Executes command #35 in the get-history list
`:Press the backward apostrophe key to insert a line break or as an >escape character to make a literal character. You can also break a line at the pipe (|) character.
Alt+Space+E: Displays an editing shortcut menu with Mark, Copy, Paste, Select All, Scroll, and Find options. You can then press K for Mark, Y for Copy, P for Paste, S for Select All, L to scroll through the screen buffer, or F to search for text in the screen buffer. To copy the screen buffer to the Clipboard, press Alt+Space+E+S and then press Alt+Space+E+Y.
Alt+F7: Clears the command history.
Ctrl+C: Break out of the subprompt or terminate execution.
Ctrl + End : Delete all the characters in the line after the cursor.
Ctrl + Left Arrow || Ctrl + Right Arrow : Move left or right one word at a time.
Ctrl + S: Pause||resume the display of output.
Esc Clear the current line.
F1 Moves the cursor one character to the right on the command line. At the end of the line, inserts one character from the text of your last command.
F2 Creates a new command line by copying your last command line up to the character you type.
F3 Completes the command line with the content from your last command line, starting from the current cursor position to the end of the line.
F4 Deletes characters from your current command line, starting from the current cursor position up to the character you type.
F5 Scans backward through your command history.
F7: Similar to get-history
. Displays a pop-up window with your command history and allows you to select a command. Use the arrow keys to scroll through the list. Press Enter to select a command to run, or press the Right arrow to place the text on the command line.
F8 Uses text you’ve entered to scan backward through your command history for commands that match the text you’ve typed so far on the command line.
F9 Runs a specific numbered command from your command history. Command numbers are listed when you press F7 or get-history
.
Page Up / Page Down: Gets the first/last command in the command history.
Right-click If QuickEdit is disabled, displays an editing shortcut menu with Mark, Copy, Paste, Select All, Scroll, and Find options. To copy the screen buffer to the Clipboard, right-click, choose Select, and then press Enter.
Tab / Shift+Tab: Press the Tab key or press Shift+Tab to access the tab expansion function, which include folder or filename autocompletion.
Best Answer
There are many options for configuring
bash
. I use the following commands to give easy command history access:-These set the Up and Down arrows to scan up and down the command history for commands beginning with the characters before the cursor on the command line (as TCC does in Windows).
As for the prompt, you can put commands to be run each time the prompt is output. I use:-
This calls two commands on each prompt:-
curspos
is a script I wrote to check the cursor position and output a new line if not in the first column (I got annoyed with unnecessary blank lines).BASH_LEVEL
checks precede the prompt with the level in square brackets if it's not 1, so it's immediately obvious if you are in a child shell (eg[2]15:55:32[~/]$
).Neither of these answers your requirement directly, but they illustrate the power that you can use in the prompt string. In your case you can simply prepend a script or function (such as
gitcheck
) to execute before the rest of your prompt, and this can output any information you want to see in the format you want as part of the prompt.I would finally comment that
fish
is available in many Linux distributions (eg it's in the Ubuntu repository), so you need do thesebash
customisations only if you are prevented from installing packages.