Deciphering this path - cygwin

I'm trying to follow this guide in order to install or link to jdk in cygwin
I'm confused about how he wants me to get from my cygwin folder to my Downloads folder.
He says this:
ln -s /cygdrive/c/Users/yourname/Downloads downloads
In the path name for the download directory, replace c: with /cygdrive/c and all backslashes () with forward slashes (/).
So my cgywin directory is this:
D:\cygwin
My path to downloads is this: C:\Users\Houseman\Downloads
I tried this path /D/C/Users/Houseman/Downloads, and C/Users/Houseman/Downloads but those didn't work.
How do I access my downloads folder, then?

/cygdrive/c is literally the path /cygdrive/c. It's Cygwin's way of accessing the Windows partitions. Leave it the way it is and it'll work.

Related

Where to put application so I can use them no matter working directory?

I installed ngrok and put it in the /bin folder. But I can only use the command ./ngrok when I'm in the /bin directory. I'm pretty new to using Linux but I'm quite shure that /bin apps/command can be used everywhere. Anybody know where to put applications so I can use them no matter what's my current working directory.
If /bin is in the $PATH, you can call it with ngrok, without specifying the current directory ./.

How to create a cygwin executable

I was trying to follow the instructions here to get drush installed on cygwin:
https://www.drupal.org/node/1432756#comment-11184267
However, running "drush" from my drupal project's folder did nothing (it didn't tell me -bash: this_command_I_made_up: command not found as it does for a command that doesn't exist).
Eventually I tried to run the symlink command like this:
ln -s /usr/local/src/drush/drush.bat /usr/bin/drush.bat
instead of this:
ln -s /usr/local/src/drush/drush.bat /usr/bin/drush
In other words, I added the .bat suffix to the filename path (drush.bat) instead of leaving it as plain old drush. Now I get results as I expect when running drush commands from my drupal project folders, but I have to type in drush.bat instead of drush when running drush commands.
I was just wondering if anyone could shed some light on the situation as to why the plain old drush symlink without the .bat suffix doesn't work. Thanks!
You may need to make the src/drush/drush.bat executable. If the symlink you make has a .bat extension (or .exe, etc.), it will automatically be executable in cygwin.
For files without extensions, the file must be marked executable.
For symlinks without extensions, the source (src/drush/drush.bat) must be marked executable.
To mark a file executable, use the command chmod +x src/drush/drush.bat.

no such file or directory (cygwin)

I am trying to install a solver (SCIP) with cygwin. After unpacking the folder consists of another 5 folders. The manual says I have to go in folder A and use make. Here, I get the message that one file was not found:
zimpl/bool.h: No such file or directory
This file is in folder B in the path zimpl/src/bool.h. How can I link this file from folder B that cygwin can use it while using make in folder A?
The support says:
Blockquote The error you postet looks like your zimpl softlink is incorrect. If you use a relative path, make sure that it is relative to the position where
the link is created. Most softlinks are created directly in the lib
directory, the zimpl softlink, however, is in a subdirectory of the lib
directory, so you have to go up two directories to get to the main SCIP
directory.
However I am not sure how to check the softlinks.
Thanks!

Why can't I see paths that exist in OSX?

I am a windows developer switching over to OSX. I am very confused though. I am learning node.js and the documentation tells me to add a reference to nodemon at the path...
/usr/local/bin/nodemon
However when I am at the terminal and I type 'ls' I get the following output...
And that doesn't have a /usr/ folder ... And what is even more confusing is that if I do...
ls -a
Then I can see all my hidden folder with a folder in called .npm which seems to have all my modules. In windows this is easy it just installs all npm modules into %AppData%/npm or something but I just don't get it on OSX can somebody enlighten me please?
ls lists the directories and files in your current working directory.
You can find your current working directory with pwd (short for 'print working directory')
You can change your current working directory with the cd (change directory) command. In your case, you could run
cd /usr/local
ls
and it would show you the bin directory. Alternatively, you could directly run
ls /usr/local
As a special extra note, the Terminal Prompt itself actually displays the current working directory (by default). In your case, it shows ~, which is shorthand for the user profile directory, which the Terminal opens to automatically. It is generally /Users/<username>.

Setting Working Directory to Desktop in Cygwin

The current directory on cygwin is home/myuser. I navigated to cygwin and found it has a directory called home/myuser and could not figure out how I would navigate to the desktop. I did not want to add a desktop directory there and I could not navigate above the root folder (cygwin). Any idea on how I could do this?
This is essentially covered in the Cygwin FAQ under "How can I access other drives?". No, you're not trying to access another drive, but you are trying to access a folder outside of the Cygwin tree. As the FAQ item says, Cygwin maps your Windows drives as /cygdrive/<drive-letter>, so your desktop is likely something like /cygdrive/c/Users/<username>/Desktop. Note that the path has changed over the years with various versions of Windows and you didn't specify what version you're running, so it may not be exactly that.
Anyway, what I would do, would be to create a symbolic link to that from my Cygwin home folder. Something like this:
ln -s "/cygdrive/c/Users/<username>/Desktop" Desktop
I put the quotes in because depending on what version of windows you have, this path may include spaces.
You'll probably notice from the FAQ that the Cygwin version of bash accepts DOS-style pathnames, so you can actually do the following:
cd "C:/Users/<username>/Desktop"
But I recommend avoiding such syntax. Not all Cygwin apps understand DOS-style paths, and you'll only end up confusing yourself if you have to try to figure out whether what you're doing will work with a DOS-style path or not. It's best to just use the Unix-style paths for everything when in the Cygwin environment, unless you have a very good reason not to.
Add
cd "/cygdrive/c/Users/<username>/Desktop"
to .bashrc file located in <cygwin install directory>/home/<username>. This will change working directory to desktop every time you open Cygwin terminal.

Resources