Linux has a very powerful and valuable command-line terminal that is used and loved by its users. As such, if you have previously used Linux's Command Line Interface (CLI) and have only recently started using the Windows Command Prompt, you're bound to feel underwhelmed by the latter's lack of features.

There are many commands that are supported on the Linux terminal that does not exist on Windows. Luckily the “ls” command is one that is supported on the Windows Command Prompt. Read on as we explore how to use the "ls" command in Windows.

What Is the “ls” Command?

The “ls” command (that's LS, not IS) is one of the first terminal commands that veterans teach Linux beginners. It allows users to list files and directories from the Command Line Interface. You can think of it as a File Explorer, but without the user-friendly icons and navigation buttons. By using the “ls” command, Linux users can list the contents of the current working directory.

FREE CHEAT SHEET: Download Our Free Windows CMD Commands Cheat Sheet

How to Use the “ls” Command in Windows

Windows is an entirely different ecosystem when compared to Linux. As a result, many Linux CLI commands are not supported by the Windows Command Prompt tool. If you try using the “ls” command in Command Prompt, you will get the following error ”ls' is not recognized as an internal or external command, operable program or batch file.”

However, you can use the “ls” command functionality in Windows using the equivalent dir command in Command Prompt.

Use dir command to list files in Windows CMD

To list files and directories using the Command Prompt in Windows 10:

1. Click on the Start menu icon, search for Command Prompt, right-click the Best Match, and select Run as administrator.

2. Once the Command Prompt window is open, navigate to the directory you want to view and type dir.

3. Command Prompt will now list all of the files in the current working directory, along with their sizes and last modified date.

A Handy Tool for Both Linux and Windows Users

If you love using Linux, you'll likely find that Microsoft's own command prompt is a bit weaker in comparison. Fortunately, the "ls" command is also on Windows; it just uses a different name.

If you haven't explored it yet, the Windows Command Prompt utility is a handy gateway to using more advanced Windows tools. It is always a good idea to be familiar with Windows CMD commands so you can make full use of your copy of Windows.