A Simple Trick with the Windows Command Prompt

If you are like me – you sometimes work in multiple environments (Windows and Linux – in my case). My brain sometimes becomes “lost” when swapping environments – so when I am working in the Windows command prompt, I often find myself typing Linux commands (like “ls” to get a directory, etc.) in the Windows command window.

Here’s my little “work-around” to my “brain fog”

First – I created a directory off the root of my C: drive (let’s call it “mydir”). Then – I added that directory (C:\mydir) to the “path” in my environment variables. In that new directory – I created a new file called “ls.cmd” and edited it to contain just the “dir” command.

Now – when I am in a Windows Command Prompt – I can just type “ls” and it will execute the Windows “dir” command.

This entry was posted in Programming.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*