Software⏱️ 2 min read📅 2026-05-31

How to Fix: How to list files in windows using command prompt (cmd). I've tried using ' ls ' as in Linux but it shows an error?

Use the command 'dir' instead of 'ls' to list files in Windows Command Prompt.

Quick Answer: Try using 'dir' instead of 'ls', as 'dir' is the native command for listing files in Windows.

📋 Table of Contents

  1. ✅ Best Solution
  2. ✨ Wrapping Up

To list files in Windows using the Command Prompt (cmd), you can use the `dir` command instead of `ls`. The `dir` command displays a list of files and subdirectories in the current directory. You can also use the `/b` option to display only file names, or the `/a` option to display all files, including hidden ones.

✅ Best Solution

Method 1: Using the `dir` Command

  1. Step 1: Open the Command Prompt and type `dir` (without quotes) in the address bar.

Example:

`dir`

This will display a list of files and subdirectories in the current directory.

✨ Wrapping Up

By using the `dir` command, you can effectively list files in Windows using the Command Prompt.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions