Changing Home Directory for cygwin - cygwin

I know that this question has been asked before on this site, but I am very new with Cygwin and am really confused by a lot of the other answers.
What is the best method to change my home directory in Cygwin?

Perhaps the most easier way is to make a folder junction with mklink.exe windows command. Assuming that you would like to use windows home directory:
Press Win + R and type cmd.
rename your cygwin home e.g.: c:\cygwin\home\username --> username_backup
type mklink /j c:\cygwin\home\username c:\Users\username
if you would like to use the contents of your old home directory you should copy them to the new one

Related

Can't change Cygwin Home Directory from /SPB_Data

I recently installed Cygwin. Its default home directory is
/cygdrive/c/Users/<username>/AppData/Roaming/SPB_Data
[Editor's note: this also applies when the directory is /cygdrive/c/SPB_Data.]
I have tried changing the db_home setting in /etc/nsswitch.conf according to this post, but that doesn't make any difference.
How do I change the home directory to /cygdrive/c/Cygwin64/home?
With high likelyhood you have installed some software from Allegro (now owned by cadence) after installing cygwin.
Allegro overwrites the windows system variable 'HOME' and sets it to 'C:\SPB_Data'
To fix this delete the enviroment variable, then the home folder can be set according to the linked stackoverflow question.
Alternatively you could set the correct home folder path in the enviroment variable, but this is not reccomnended according to cygwin documentation.
cygwin documentation: https://cygwin.com/cygwin-ug-net/setup-env.html
Also see this old forum post
https://community.cadence.com/general_topics/f/feedback-suggestions-and-questions/17969/orcad-install-killed-oracle-virtualbox
I registered to reply to this old question since it is the top result on google (for me at least) when searching for 'cygwin SPB_data'. And this question sendt me in the right direction, but did not contain the correct answer.
see https://cygwin.com/cygwin-ug-net/ntsec.html#ntsec-mapping-nsswitch
and set on /etc/nsswitch.conf
db_home: /home/%U
Don't use notepad as it will set the line end to windows default CRLF
After changing the file, close all cygwin processes, as its value is read at
cygwin start.

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.

.bashrc in Cygwin 1.7

I'm running Cygwin 1.7.17 on Windows Server 2012. My user account is "Administrator". Where should I put a .bashrc file for the Cygwin bash to pick it up?
I've tried the "c:\users\Administrator" folder, which seems to be the HOME in Cygwin 1.7. Tryed c:\cygwin\home\Administrator also.
Start a shell instance and run the command echo $HOME to see what your home path is set to. That's where all your user config files will be read from. It might not be one of the paths you tried.
Once you know where it is, just copy the template .bash_profile and .bashrc files from the /etc/skel folder to get you started.
If you don't like the path that's currently being used as your home, you can change it by editing /etc/passwd. Here's more info on that... Safely change home directory

Where does Eclipse look for eclipse.ini under Linux

I've just been setting up a Ubuntu workstation and wanted to add some settings to eclipse.ini. When I searched for the file I found:
/etc/eclipse.ini
/usr/lib/eclipse.ini
My questions are:
Does Eclipse actually use both files?
If so, in what order does it read them?
How does it merge them?
Both of the files I found are system wide, is there a location in my home directory I could put one that would effect only my instances?
Here's how to determine which eclipse.ini file you should use (joomla.org):
If you downloaded Eclipse IDE manually from internet the "eclipse.ini" file is just inside the unpacked folder
If you installed Eclipse via terminal or software center the location of the file is "/etc/eclipse.ini"
In some Linux versions the file can be found at "/usr/share/eclipse/eclipse.ini". Do not use this file if you found a config file at "/etc/eclipse.ini".
To be sure where your Eclipse folder is, check $ECLIPSE_HOME, and if not specified (these directions at least work for Juno):
Open Eclipse as you normally do.
Click Help -> About Eclipse SDK
Click Installation Details
Go to the Configuration tab
Find "eclipse.home.location=file:PATH". PATH is where eclipse is installed.
sources:
http://docs.joomla.org/Configuring_Eclipse_IDE_for_PHP_development/Linux:
There is only one file.
lrwxrwxrwx 1 root root 16 Aug 8 2012 /usr/lib/eclipse/eclipse.ini -> /etc/eclipse.ini
You probably have already found this out, chances are when you installed Eclipse the installation created (or you did manually) a file /usr/bin/eclipse which if you check it probably looks like the following:
#!/bin/sh
export ECLIPSE_HOME="/opt/eclipse"
$ECLIPSE_HOME/eclipse $*
especially if you followed instructions similar to the ones like these on If-not-true-then-false
On the other hand if you have installed from a package, I suspect you will find that eclipse ends up in /usr/bin, most likely a symbolic link to /usr/lib/eclipse/eclipse (or at least I found it on my Fedora system after using yum to install eclipse).
I have Ubuntu 18 and eclipse installation is squashed in a file
/var/lib/snapd/snaps/eclipse_40.snap
which is mount on /snap/eclipse/40 as read only. Just run
mount | grep eclipse*.snap
This eclipse.ini file is really read only, that means, you cannot modify it, even with sudo. However, I also have a eclipse.ini.ignored file in HOME/.eclipse/some number/configuration. This is being by default ignored, but you can change the "launcher.ini" in the eclipse launcher command.
According to https://wiki.eclipse.org/Eclipse.ini
Eclipse startup is controlled by the options in
$ECLIPSE_HOME/eclipse.ini. If $ECLIPSE_HOME is not defined, the
default eclipse.ini in your Eclipse installation directory (or in the
case of Mac, the Eclipse.app/Contents/MacOS directory) is used.
The certain way to make sure is to run strace on eclipse. In the output you'll see where is eclipse actually trying to pull the file from.

Where to keep Aptana Studio 3 IDE unzipped folder?

Aptana for linux comes as ready-to-launch zipped package. The
problem is that I don't know where I should put this unzipped folder.
I don't like it being in (polluting!) my home folder.
Where would you put this? Any suggestions? Where do you keep your Aptana's folder? Where would be the most elegant place? Is there special place to put such executables (like C:/Program Files on Windows)?
I keep that kind of stuff in my /opt directory.
This is how i have it setup:
1. I have created /home/bin and put the execs there (added bin to my Path so i can open Aptana straight from the terminal)
2. Created a "development" folder in the home folder (same level as Documents) and i have all my projects in that directory.
I am really not sure this is the right way since I am new to this too but this is what made sense to me.

Resources