In my current project, I am stuck with Windows 7 which means no Bash :(
I could have installed Cygwin as usual but this time, I decided to extend my knowledge of the Windows command line and I found this: doskey. With the doskeys defined below, the Windows command line is still far from being as powerful as an old good Bash but it is a bit more user friendly.
Even better, I found the Windows PowerShell which has familiar notions like profile and aliases.
The doskeys I use:
My PowerShell profile:
Recommended link:
I could have installed Cygwin as usual but this time, I decided to extend my knowledge of the Windows command line and I found this: doskey. With the doskeys defined below, the Windows command line is still far from being as powerful as an old good Bash but it is a bit more user friendly.
Even better, I found the Windows PowerShell which has familiar notions like profile and aliases.
The doskeys I use:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:: http://technet.microsoft.com/en-us/library/bb490894.aspx | |
:: F7 = history | |
:: Alt+F7 = history -c | |
:: F8 = Ctrl+R | |
:: Use & to run multiple commands e.g.: command1 & command2 | |
:: Add this file as a REG_SZ/REG_EXPAND_SZ registry variables in HKEY_LOCAL_MACHINE\Software\Microsoft\Command or Processor\AutoRun HKEY_CURRENT_USER\Software\Microsoft\Command Processor\AutoRun | |
@echo off | |
:: Linux commands | |
doskey alias = doskey $* | |
doskey cat = type $* | |
doskey clear = cls | |
doskey cp = copy $* | |
doskey cpr = xcopy $* | |
doskey grep = find $* | |
doskey history = doskey /history | |
doskey kill = taskkill /PID $* | |
doskey ls = dir $* | |
doskey man = help $* | |
doskey mv = move $* | |
doskey ps = tasklist $* | |
doskey pwd = cd | |
doskey rm = del $* | |
doskey rmr = deltree $* | |
doskey sudo = runas /user:administrator $* | |
:: Easier navigation | |
alias o = start $* | |
alias oo = start . | |
doskey .. = cd ..\$* | |
doskey ... = cd ..\..\$* | |
doskey .... = cd ..\..\..\$* | |
doskey ..... = cd ..\..\..\..\$* | |
:: Maven | |
:: Requires M2_HOME\bin to be added to the Path environment variable | |
:: -rf --resume-from <project> | |
doskey mci = mvn clean install | |
doskey mcis = mvn clean install -Dmaven.test.skip | |
doskey mcp = mvn clean package | |
doskey mcps = mvn clean prepare-package war:exploded -Dmaven.test.skip | |
doskey mct = mvn clean test | |
doskey mvns = mvn $* -Dmaven.test.skip=true | |
:: User specific doskeys | |
:: Add your own doskeys below |
My PowerShell profile:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://technet.microsoft.com/en-us/library/ee692685.aspx | |
# F7 = history | |
# Alt+F7 = history -c | |
# F8 = Ctrl+R | |
Set-Location C: | |
# Easier navigation | |
Set-Alias o start | |
function oo {start .} | |
function .. {Set-Location ..} | |
function ... {Set-Location ..\..} | |
function .... {Set-Location ..\..\..} | |
function ..... {Set-Location ..\..\..\..} | |
# | |
function google ($q) {start http://www.google.com/?#q=$q} | |
function so ($q) {start http://stackoverflow.com/search?q=$q} | |
# Maven | |
# Requires M2_HOME\bin to be added to the Path environment variable | |
# -rf --resume-from <project> | |
function mci {mvn clean install} | |
function mcis {mvn clean install '-Dmaven.test.skip'} | |
function mcp {mvn clean package} | |
function mcps {mvn clean prepare-package war:exploded '-Dmaven.test.skip'} | |
function mct {mvn clean test} |
Recommended link:
Comments
Post a Comment