Cygwin ls command not found

This is a question that I myself answered my technical blog, where I keep the technical tips that I need to give myself from time to time, so I decided to move it here. The original blog post is here: http://thehacklist.blogspot.com/2009/04/cygwin-ls-command-not-found.html

If you are a linux enthusiast and really skip these greps and sed / awks in a Windows window, you probably installed cygwin , you tried to run it by double-clicking the cygwin icon on the desktop or the cygwin.bat file in the C:\cygwin directory and received an invitation bash-3.X$ . However, although the pwd or cd commands work if you try ls , it says: ls: command not found .

+48
path cygwin ls
Feb 10 '13 at 11:25
source share
2 answers
  • Right-click on “My Computer” → Properties → Advanced → Environment Variables.
  • Add a new environment variable called CYGWIN_HOME and set its value to C: \ cygwin
  • Edit the PATH environment variable and add to it C: \ cygwin \ bin (usually separated by the ';' character).
  • Just click “OK”, exit any command line prompts or bash shells (via cygwin) that you can open, and open again - it will work!

Assumption - this assumes that you installed cygwin in C:\cygwin . If you saved it somewhere else, please modify the above.

+58
Feb 10 '13 at 11:25
source share

Check the cygwin.bat file, it should have something like:

 set PATH=C:\cygwin\bin;C:\cygwin;%PATH% ...etc bash --login -i 

(you really don't need c: \ cygwin, but I have some additional scripts / bat files, the main thing is c: \ cygwin \ bin)

+10
Feb 10 '13 at 11:34
source share



All Articles