The WelDuh!

giving you the Well Duh! on life

Basic Linux Commands Under Windows

Thursday, June 12th, 2008

Personally I run linux at home but at work like many other people I am somewhat forced to run windows. Now windows command line or dos prompt isn’t as powerful as the shells available to you in linux, but it is still a powerful tool. Just being able to use wild cards (*) to delete files is easier than using explorer. But I when in windows dos prompt I tend to have a problem of typing linux commands when I want to do things, particularly ls when I want to type dir.

So to solve this I have created a few batch files, example:

ls.bat:
@echo off
dir %1 %2

This can be done with many of the equivalent dos commands, the percentages are the arguments after the command, e.g. ls /p *.jpg will be passed along as dir /p *.jpg. There are a few more commands that are easy to translate into linux like del, copy and move. But always be careful as not all dos commands use the same switches or syntax as their linux counterparts.