When I tried to use list ls
on a Windows command prompt, the system doesn't recognize it. I already added C:\Windows\System32
in the path.
Asked
Active
Viewed 9.4e+01k times
241
-
18`ls` is a unix command, not Windows – Hunter McMillen Mar 10 '17 at 20:36
-
8Since this is the first Google hit for `ls windows`: for those who don't want to learn Windows commands, I downloaded the GnuWin32 [CoreUtils package](http://gnuwin32.sourceforge.net/packages/coreutils.htm) and added the `bin` dir to my `PATH`. There are lots of other good gnu utils on that site. Cheers! – ipetrik Nov 28 '17 at 21:30
-
`ls` is a Unix command, not Windows. But if you still want `ls` in Windows, you can download it from http://unxutils.sourceforge.net/ – Apr 12 '18 at 04:00
-
4Stack Overflow is for _programming_ questions. Trivial interactive use of a CLI is not programming. – tripleee Apr 25 '21 at 07:18
-
Actually, ls is also Windows PowerShell command that try to mimic unix ls. – Ding-Yi Chen Dec 09 '21 at 04:42
1 Answers
423
Use the command dir
to list all the directories and files in a directory; ls
is a unix command.

Manan Mehta
- 5,501
- 1
- 18
- 18
-
57`echo @dir %* > %systemroot%\system32\ls.bat` will allow you to use `ls` instead of `dir`, similarly to an alias – Neil Jun 22 '18 at 23:27
-
3
-
this is helpful, just type dir in the cmd not the filename and dir. – CodeConnoisseur Dec 21 '18 at 00:51
-
@Webman, I was able to open dir horizontally when I opened it in the bash terminal rather than just the Windows CMD – CodeConnoisseur Dec 21 '18 at 00:52
-
5
-
-
I did `echo @dir %* /OG /W > %systemroot%\system32\ls.bat`, so when I type `ls` it will display directory horizontally sorted by "folders first" – GooDeeJAY Jul 03 '21 at 18:53
-
Downvote it because Windows powershell actually have ls, just not cmd. – Ding-Yi Chen Dec 09 '21 at 04:44