Skip to content

Instantly share code, notes, and snippets.

@dimanyc
Forked from PierreMage/PowerShell-profile.ps1
Last active November 21, 2021 18:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dimanyc/fb195e660a9084891905 to your computer and use it in GitHub Desktop.
Save dimanyc/fb195e660a9084891905 to your computer and use it in GitHub Desktop.
Make your Windows command line better with doskey
:: 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
::
:: 1. Go to your Windows folder and find regedit.exe
:: 2. Head over to:
:: HKEY_LOCAL_MACHINE\Software\Microsoft\Command
:: or
:: Processor\AutoRun HKEY_CURRENT_USER\Software\Microsoft\Command Processor\AutoRun
:: 3. Add a "String Value" with any name / key (e.g. "Autorun")
:: 4. Insert an absolute path to your doskey file in the "value" field.
:: 5. Restart your cmd
@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
:: examples:
:: doskey be = bundle exec
:: doskey gs = git stash
@dimanyc
Copy link
Author

dimanyc commented Oct 22, 2015

updated installation instructions for Win users

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment