[doskey]윈도우에서 Cmd에 alias설정하기
#설명
리눅스에서 alias를 편하게 자주 사용하는데 CMD에서도 사용하고 싶을때가 있습니다, 윈도우에도 비슷한 기능이 있는데요 바로 doskey 입니다

seen from Russia
seen from Netherlands
seen from United States
seen from United States
seen from United States
seen from Ukraine
seen from United States
seen from China

seen from United States
seen from China

seen from Japan
seen from Canada
seen from United States
seen from United States

seen from United States
seen from China

seen from United States
seen from Malaysia
seen from China
seen from China
[doskey]윈도우에서 Cmd에 alias설정하기
#설명
리눅스에서 alias를 편하게 자주 사용하는데 CMD에서도 사용하고 싶을때가 있습니다, 윈도우에도 비슷한 기능이 있는데요 바로 doskey 입니다
Running Ruby scripts with DOSKEY
Let’s say you want to run a ruby script a bunch of times, but you want to do so temporarily (no permanent changes/aliasing). As long as you’re within the same command session it’s pretty simple, but there are a couple of things to watch out for.
If your script involves ARGV in some way, you have to include that in your macro definition. The following will not work to display/run whatever’s triggered by a user’s question command:
DOSKEY roll=ruby file_name.rb roll question
You have to set the command to include the possible entry options. The following will work for the above scenario, assuming that your underlying Ruby code works.
DOSKEY question=ruby file_name.rb question question
You will have to reset these if you leave the session, but if you’re doing something temporary like running a script to test someone’s knowledge before a test or interview, this works pretty well.
How to download a whole folder using wget on Windows or Linux and cmd magic
We sometimes need to download some full ftp folder, especially when teachers / lecturers share some materials (or presentations) and won't think of putting it in one archive. If we try just using command:
wget http://some.ftp.com/folder/and/folder2
we would get index.html file. We should do that this way:
wget -r -np -nH –cut-dirs=3 -R index.html http://some.ftp.com/folder/and/folder2
We will get all the files from folder2. I found this solution here. It seems that there's more nerd friendly stuff.
But to explain it to humans: you use wget from command line. On Windows it would be cmd.exe. You may just search for cmd.exe and I recommend to make a shortcut for it, which we will use for some nice trick.
Normally wget installs to "C:\Program Files\GnuWin32\" and application executable is inside folder "bin". So, to use it in command line, we would need to type or copy full path every time we use it, but here comes doskey:
DOSKEY wget="C:\Program Files\GnuWin32\bin\wget.exe" $*
This command makes "wget" point to our wget.exe binary. But after exiting cmd, it will 'forget' what we set with doskey. To avoid this, we create a *.cmd file using notepad or whatever text editor we like, paste above code there and save as "filename.cmd". It should look like this:
@echo off DOSKEY wget="C:\Program Files\GnuWin32\bin\wget.exe" $*
Thanks to first line we won't see any notifications starting terminal with this file. We create then shortcut to cmd.exe, and then edit it to make it point to "C:\Windows\System32\cmd.exe /K C:\path\to\your\file.cmd". Now when we start cmd using our link "wget" runs wget. We may also add an alias for downloading full directory:
DOSKEY wgetdir="C:\Program Files\GnuWin32\bin\wget.exe" -r -np -nH ‐‐cut-dirs=3 -R index.html $*
Now command for downloading a whole ftp directory and its subdirectories would be:
wgetdir http://some.ftp.com/and/its/folders/
I hope you enjoy being nerds with me.
Here's where I found the doskey solution.