“ls” alias in Windows

It’s such a small hack, but I’m not a Windows guy, and I get caught out multiple times a day typing ls instead of dir to view files in the working directory when using cmd.exe.

This is already available for PowerShell, but just a simple hack to get around this for the Windows Command Prompt.

  1. Create a batch file called “ls.bat”
  2. In the batch file, simply put “dir”
  3. Add this file to a location in your PATH




 Volume in drive C is Windows
 Volume Serial Number is 0413-1979

Directory of C:\Users\jonathan.els\Scripts

16 May 2018 11:44 PM <DIR> .
16 May 2018 11:44 PM <DIR> ..
16 May 2018 11:41 PM 5 ls.bat
 1 File(s) 5 bytes
 2 Dir(s) 129 793 744 896 bytes free


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 )

Google+ photo

You are commenting using your Google+ 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