Cygwin: Mapping a directory

2

I want to map a directory c:\Animal\Cat to /Cat So that when i use Cygwin, and just type cd /Cat from any directory, it goes to /c/Animal/Cat
How would i do that?

I have already done mount -c /, so i have the following when i do the df command:

Filesystem     1K-blocks Used      Available  Use% Mounted on  
C:/cygwin/bin  488384532 187949036 300435496  39% /usr/bin  
C:/cygwin/lib  488384532 187949036 300435496  39% /usr/lib  
C:/cygwin      488384532 187949036 300435496  39% /  
C:             488384532 187949036 300435496  39% /c  

stumped

Posted 2013-08-26T00:01:54.593

Reputation: 23

Answers

1

Depending on how you'd prefer to tackle this, here are two suggestions:

  • You can create a symbolic link for this directory:

    ln -s /source/directory/ /Cat

    You can test this by then running ls /Cat

  • You can create an alias to simply move to the directory using a friendly name:

    cat >>.bashrc
    # Alias for changing to a desired directory
    alias Dog='cd /source/directory'

Then issues the command source ~/.bashrc or log out and back in. Then, issuing the new Dog alias will cd to your desired directory.

It may be best to steer clear of aliasing system commands when using friendly names in your .bashrc that are close to them (Replace cat with Dog for instance).

one.time

Posted 2013-08-26T00:01:54.593

Reputation: 623