To change directory, you can use cd command with the target directory parameter.
The target directory can be expressed in a DOS-like manner (d:/ or d:/Ogo1.2).
Note that drives in Cygwin are treated as directories, and the usage of forward slash in place of
the DOS backslash (d:/Ogo1.2 instead of d:\Ogo1.2).
Instead of DOS-like directory specification, you can use canonic Cygwin directory specification, which
maps all system drives to subdirectories in the directory /cygdrive/.
I.e. DOS C: drive can be accessed in Cygwin by /cygdrive/c, D: as /cygdrive/d, etc.
To display the contents of the current directory, you can use ls or dir commands.
ls -la will provide more details, including file access permissions, size and modification date.
To run Windows Explorer in the current Cygwin directory, you can type
$ explorer .Note the 'dot' at the end of the line. Dot means 'current directory', while double dot '..' means parent directory.
A useful Bash feature is automatic filename completion. If you start typing a filename (as in the screenshot, we start typing cd gtk to change to gtkwave directory), and press the Tab key, Cygwin will automatically complete the name with the filename from the current directory. If there are more than one files with the same beginning of the name, double Tab will display a list of possible completions.
$ which explorer /cygdrive/c/WINNT/explorerIf you are having problems executing a program, e.g.
$ foo -a 1 foo: Command not foundtry examining the value of the PATH variable
$ echo $PATH /usr/local/bin:/usr/bin:/bin:/cygdrive/c/PROGRA~1/Borland/CBUILD~1/Projects/Bpl: /cygdrive/c/PROGRA~1/Borland/CBUILD~1/Bin:/cygdrive/c/WINNT/system32:/cygdrive/c /WINNT:/cygdrive/c/WINNT/System32/Wbem:/cygdrive/c/matlab6p1/bin/win32:/cygdrive /c/Program Files/Hummingbird/Connectivity/7.10/Accessories/:/cygdrive/d/ogo1.2/l cc/lccdir:/cygdrive/c/PROGRA~1/Borland/CBUILD~1/Projects/Bpl:/cygdrive/c/PROGRA~ 1/Borland/CBUILD~1/Bin:/cygdrive/c/WINNT/system32:/cygdrive/c/WINNT:/cygdrive/c/ WINNT/System32/Wbem:/cygdrive/c/matlab6p1/bin/win32:/cygdrive/c/Program Files/Hu mmingbird/Connectivity/7.10/Accessories/and check if the program you're trying to execute is in any of the directories named there. Note that the Cygwin root directory '/' is where you installed cygwin, e.g. c:\cygwin. E.g. /usr/bin in the default installation is in fact c:\cygwin\usr\bin
Note that by default the current directory (.) is NOT in the PATH. Therefore if you want to call an executable in the current directory, you need to specify the path to it, i.e. instead of
$ foouse
$ ./foo
$ PATH=/cygdrive/c/new/directory/with/executables:$PATHThis will however only be set for the current Bash session, so if you close Bash window, this change will be lost.