how to create symlink?
August 12th, 2006 mysurface Posted in Admin, ln | Hits: 22287 |
First of all symlink stand for symbolic link, which is a very useful files like shortcuts in windows. Let me make few scenario why you need symlink.
Sometime, we want to goes to a directory which is very long and difficult to remember, for example /var/www/html/BLOG/Image/Archive/_icon. And you have to access to that directory oftenly after you login as root. What do you do to make your life easy? You can create a symlink in root home directory which is /root, like:
ln -s /var/www/html/BLOG/Image/Archive/_icon /root/icon
You are creating a symlink call icon at /root which links you to /var/…._icon. Now you can easily go to _icon directory by
#assume you now at /root
cd icon
|
|
The second scenario where I create a symlink to my bash script where I store my symlink to /usr/local/bin.
I have write a sort of bash scripts to help me manipulate my work and I store them into a directory call sh. So everytime I want to run my script i have to go to sh directory and ./something.sh, which is very inefficient. so I create symlink and store at /usr/local/bin
ln -s /home/myname/sh/runme.sh /usr/local/bin/runme
So that when I want to run that script, I can just run it like other commands without specified ./ Another good thing is I can edit my scripts without relink or recreate the symlink, the changes will be reflects to the symlink automatically.
Live Chat!









August 30th, 2006 at 1:57 am
[...] If you have directory symbolic link to lead you to certain directory, you may notice that when you change directory to symlink directory, the path will be symlink by default. [...]
December 10th, 2006 at 1:45 am
[...] Check out more about symlink at here. [...]
April 26th, 2007 at 3:36 am
Great explanation really helped me create a symlink for a ruby on rails installation on my web host. Don’t have access to my apache_conf so needed away to relink my public folder and my knowledge of sys-admin is intermediate
October 4th, 2007 at 9:38 am
thanks for this tip, you saved my hour…
Eliena Andrews
http://www.visitformoney.blogspot.com