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.

Cmder Logo

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’.

Windows Environment Variables Settings Screenshot

3. Append the path to the Cmder executable into the PATH system environment variable
e.g. C:\cmder\vendor\git-for-windows\usr\bin.

Windows Environment Variables Settings Screenshot

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.

Shane Bartholomeusz