Problem
Recently whilst using Cmder on Windows 11, I encountered the below error while running command ‘ls’ to list the files, and in this post I’ll explain the solution that worked for me.
‘ls’ is not recognized as an internal or external command, operable program or batch file.
Solution
When Cmder is used on the Windows platform, it handles the ‘ls’ command, which obviously isn’t native to the Windows command line. In this case, the above error indicates that the command ‘ls’ was not found in the PATH variable.
The solution is as follows:
1. Search for ‘Edit the system environment variables’ in the Windows Start menu.
2. Click ‘Environment Variables’.
3. Append the path to the Cmder executable into the PATH system environment variable
e.g. C:\cmder\vendor\git-for-windows\usr\bin.
4. Now, restart Cmder and the problem should now be resolved. Yay!
Final Thoughts
When it comes to using the command line on the Windows platform, Cmder is still my preferred command line program.
I hope this solution has helped resolve the issue when listing files through Cmder. If you find any alternative solutions, then feel free to post them in the comments below to help others out there.
- Solved: Build Errors Not Showning in VS 2022 - 21st November 2024
- How To: Configure VSCode to Trust Self-Signed Certs - 16th August 2024
- Solved: GitHub Actions – HTTP 403: Resource not accessible by integration - 13th June 2024
Leave a Reply