Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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  
share|improve this question

1 Answer 1

up vote 1 down vote accepted

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).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.