Hello all,
I've got a compiler I'd like to be able to reference from any directory on my system by just using the file's name and not it's whole directory path. I think what I'm talking about would be called a symbolic link. How can I set this up?
Hello all,
I've got a compiler I'd like to be able to reference from any directory on my system by just using the file's name and not it's whole directory path. I think what I'm talking about would be called a symbolic link. How can I set this up?
Last edited by woodsonoversoul; March 8th, 2010 at 09:05 PM.
ln -s
Last edited by steindor2; March 8th, 2010 at 08:46 PM.
Thats what I thought, but when I enter:
to make it so that I just have to type 8g <filename> to compile, wherever I am, I get:Code:ln -s /home/dan/go/src/cmd/8g/8g 8g
What gives?Code:8g: command not found
Are you sure you want a symbolic link and not an update to your path?
Do you want to be able to run your compiler program from within a terminal, regardless of the current directory? That sounds more like a path update. A symbolic link makes a file or directory appear in a different place or under a different name.
yes, then that's what I want to do, update my path...
In that case, try:
$ export PATH=$PATH:<path_to_your_program>
If that works, there are a multitude of ways of making it permanent, depending on what you want.
Adding the above line to ~/.bashrc is a start, then read the options here:
http://ubuntuforums.org/showthread.php?t=2793
Will I need to restart the terminal?
I added:
to the end of ~/.bashrcCode:$export 8g=$HOME/go/src/cmd/8g/8g
Sorry, I perhaps didn't make it completely clear. PATH is the variable that defines the path. So you need something like:
$ export PATH=$PATH:$HOME/go/src/cmd/8g/
That assumes your program 8g is in the directory $HOME/go/src/cmd/8g.
Then you should just be able to type:
$ 8g
I'm assuming that the 8g file is already executable. If not, go to $HOME/go/src/cmd/8g and type:
$ chmod u+x 8g
Bookmarks