Wednesday 17 February 2010

Win7Tip: Create Unix ls and ls -l replacements

Q: Is there an equivalent the Unix directory commands ls and ls -l on Windows 7?

A: Yes there is, the dir command.

ls is equivalent to dir /w

ls -l is equivalent to dir



My brain is so hardwired for the bash shell now, that I make batch file equivalents for these programs. I create the following programs in the c:\Windows directory. To create files in this directory under Windows 7, you need to run as Administrator



ls.bat

@dir /w %1 %2 %3 %4 %5



The 5 numbers allow you to add parameters to the command for example ls c:\directory.



For a long list I use the common alias of ll.

ll.bat

@dir %1 %2 %3 %4 %5

No comments:

Post a Comment