Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Command 'ls' not working in command prompt

Command 'ls' not working in windows Getting an error while executing 'ls'

'ls' is not recognized as an internal or external command, operable program or batch file.

like image 567
Joel K Thomas Avatar asked Jul 15 '26 06:07

Joel K Thomas


2 Answers

Use the command dir to list all the directories and files in Windows; ls is a unix command.

like image 82
Sodium Avatar answered Jul 19 '26 04:07

Sodium


Please follow below steps to fix this

  1. download and install git https://git-scm.com/downloads.

  2. After git installation is completed,navigate to folder where git is installed. Check in C/Program Files Folder. Navigate to C:\Program Files\Git\bin

  3. Add the above location (C:\Program Files\Git\bin) in path variable in system environment variables.

  4. Restart cmd and try to run ls and other Linux commands.

It should work now!!`

like image 42
Tahera Firdose Avatar answered Jul 19 '26 05:07

Tahera Firdose