Last active
December 18, 2020 04:17
-
-
Save sandipchitale/e9e6057951c95bc60e08eb76bd1817c7 to your computer and use it in GitHub Desktop.
Save and show and put history in clipboard with REM prefix
This file contains hidden or 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
-="C:\Program Files\Microsoft VS Code\Code.exe" "%USERPROFILE%\cmd.history" | |
_=doskey /history | wsl grep -e '^^[-_+.]' -v | wsl grep -e '^^break' -v | wsl grep -e '^^)' -v | findstr "^" >> "%USERPROFILE%\cmd.history" | |
+=type "%USERPROFILE%\cmd.history" | |
.=type "%USERPROFILE%\cmd.history" | wsl awk 'BEGIN { print "break||(" ;} { print $1 } END { print ")" }' | clip | |
_u=(type "%USERPROFILE%\cmd.history" | wsl awk '!a[$0]++' | findstr "^" > "%USERPROFILE%\cmd.history.bkp") && (type "%USERPROFILE%\cmd.history.bkp" > "%USERPROFILE%\cmd.history") && (del "%USERPROFILE%\cmd.history.bkp") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment