Saturday, December 16, 2017

How to create symbolic link on Lubuntu

How to create symbolic link on Lubuntu

In linux world you can create symbolic link or soft link, this is very useful for creating alias that reference to another file, if you don't understand what i'm saying, it's pretty much like shortcut.

You can create symbolic link using command line tool named ln, normally you also use -s as the parameter, so it should be ln -s, here's an example:
ln -s [source] [alias]

For demo, let's create an alias for command ls and the alias will be named show-me, the idea is when you run show-me on the terminal it will call to the original ls command, the show-me command will works exactly the same as ls, because basically it's calling the same thing.

The ls command is located under /bin/ls, as for the alias we are going to put it under /usr/bin/show-me so that it can be call from anywhere (globally).
sudo ln -s /bin/ls /usr/bin/show-me

Now go ahead run show-me command :
show-me
show-me -l
show-me -lh

To delete symbolic link, simply use the rm command just like deleting file or directory.
sudo rm /usr/bin/show-me



~ have fun guys ~

No comments:

Post a Comment