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.
- Create a batch file called “ls.bat”
- In the batch file, simply put “dir”
- Add this file to a location in your PATH
C:\Users\jonathan.els\Scripts>ls C:\Users\jonathan.els\Scripts>dir 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 C:\Users\jonathan.els\Scripts>
Guess I’m not the only one after all. This is fantastic! I’ll share a similar tip. I’m sure there’s a cygwin grep and plenty of 3rd party grep-like apps out there, but for what I typically have to use cmd for is what you wrote about above and to do an ipconfig /all but grep’ing just the ipv4 addresses and/or macs. You can use findstr for that as in ipconfig /all | findstr “IPv4”. Of course there are a bunch of other flags, but the goal isn’t to make myself at home with windows, just to make do.
LikeLiked by 1 person
Thanks for the tip!
LikeLike