Use MAC/Linux like commands in windows with alias

If you work on multiple systems and all of them are running different os, you keep missing things.

At home I work on mac and raspberry pi. At work its windows all the way. So while working in office I always type  “ls“ in the cmd. “clear“ instead of “cls“ .

This has becoming annoying, so googled and found this gem in 2015. Have been using it ever since.

doskey  ls=dir

The doskey command allows you to create macros and alias to commonly used command. Make working in cmd much more productive.

The first thing I do when I get to a new windows system is fire this commands.

doskey /macrofile=path/to/filename

Here’s the alias.txt text file than I use.

ls=dir $*
cp=copy $*
open=start $*
python=C:\Python\python.exe $*
s=start https://www.google.co.uk/search?q=$*
newsuk=start http://news.google.co.uk
cat=type $*
cal=python -m calendar $1 $2
serve=set ptemp=%cd%  && cd $* && start python -m SimpleHTTPServer 8888 && cd %ptemp%
web=python -m webbrowser -t $*
news=start http://news.google.co.in

Do you use Doskey?

4 thoughts on “Use MAC/Linux like commands in windows with alias

  1. Very useful post!
    In the past, I used to add some scripts to system32 for some commands, e.g:
    I create C:\Window\system32\ls.bat that contains: dir /b
    The same thing with clear: C:\Windows\system32\clear.bat that contains: cls

    The advantage is that I don’t have to worry about that everytime I open a cmd. I don’t know if your approach works the same; do you need to invoke the macro file everytime you open a new command line prompt?

    Thanks

    Like

    • Yes you have to do this every time you invoke CMD. But this limitation can be over come by a registry trick. I will post in the comments section soon. I have done it on my office laptop.

      Thanks for reading

      Like

  2. Pingback: Calendar in Cmd | SukhbinderSingh.com

  3. Pingback: Supercharge WindowsCMD with Git Bash | SukhbinderSingh.com

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s