create symbolic link in linux

Symbolic link is a shortcut or alias to another file in linux, unix, mac or any other nix systems.
The syntax for creating a symbolic link:
[code language=”text”]
ln -s "target file" "shortcut"
[/code]

Example
[code language=”shell”]
ln -s /usr/local/bin/myscript.sh myscript.sh
[/code]

After the above command, if you do a ls -l you will see something like this which tells you that the symbolic link(myscript.sh) in your current directory is point to /usr/local/bin/myscript.sh
[code language=”shell”]
lrwxr-xr-x myscript.sh -> /usr/local/bin/myscript.sh
[/code]

To unlink the symbolic link
[code language=”shell”]
unlink myscript.sh
[/code]

Search within Codexpedia

Custom Search

Search the entire web

Custom Search