Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Development Tools

Chandler Tayek
Chandler Tayek
5,513 Points

Creating a symbolic link in windows

I want to be able to use sublime text 2 to open files in my git terminal (aka command line) in windows. I ran

ln -s /c/Program\ Files/Sublime\ Text\ 2/sublime_text /c/Windows/system32/subl

Expected to be able to type subl and then file name or directory to open up a file through my command.

What actually happen:

no such file or directory 

I think where I went wrong is the second argument but I'm not sure where I can put the symbolic link. Other places said maybe usr/bin or usr/local/bin.

3 Answers

James Barnett
James Barnett
39,199 Points

Chandler Tayek -

I should have read your original post more carefully, sorry about that.

On 2nd thought ...

I think where I went wrong is the second argumen

I think it's the first I don't think a file named sublime_text exists but I think one name sublime_text.exe does

ln -s /c/Program\ Files/Sublime\ Text\ 2/sublime_text.exe /c/Windows/system32/subl

Symbolic links are a Linux command not windows. To the best of my knowledge yo can't do in windows

James Barnett
James Barnett
39,199 Points

Symbolic links are a Linux command not windows

Nope symbolic links are a file system concept not unique to Linux.

To the best of my knowledge yo can't do in windows

mklink was added in Vista, before that 3rd party implemention of soft links called "junctions" were supported in Windows 2000/XP.

but the command he is using "ln" is a unix command and not a windows command. hence his error.

James Barnett
James Barnett
39,199 Points

the command he is using "ln" is a unix command

yep, ln is a command symbolic links are a functionality, it's provided in Windows with mklink and in Linux with ln.

Also I should have paid more attention, his error has nothing to do with ln it's saying that's an invalid path.

James Barnett
James Barnett
39,199 Points

It depends on how you choose to install git bash to how you can access those tools.

I selected the option to unix tools to my path so they are available everywhere.

No matter, there's more than one way to do it. If you are running Vista or better you can just use mklink from the Windows command line.

http://ss64.com/nt/mklink.html

Chandler Tayek
Chandler Tayek
5,513 Points

It says that the command mklink is not found.... :(

Chandler Tayek
Chandler Tayek
5,513 Points

Btw I'm using git bash's terminal for windows

James Barnett
James Barnett
39,199 Points

It says that the command mklink is not found

mklink is a Windows command so make sure to run it on a Windows command prompt not on a gitbash prompt.

I'm using git bash's terminal for windows

When you installed msysgit, there were 3 different options of how gitbash