GAURAV KUMAR

Thursday, July 23, 2009

symbolic link(linux) Virus Incident

hello friends,
today I would like to discuss a very simple topic related to linux and how it bothered me.recently I was working with linux trying to learn "symbolic links".Symbolic link is a special file which points to another file in the system.it is similar to shortcut in windows.

if you give the command ls -l in your terminal then you can view link files.if output starts with l then it's symbolic link.now,to create a symbolic link we have to use "ln" command with -s option."ln" is for link and "-s" is for symbolic option.syntex is like this ln -s source destination.

now, source means the path of file or directory where it originally is. and destination means the path where you want the link to be.you have to specify the name of link and this should not exist in system otherwise it will give error.

But I did something which I forgot later.I made a symbolic link by typing this ln -s /home/gaurav /home/gaurav/h. since every file of linux was in "gaurav" folder ,when i went in "h" folder inside "gaurav",i found all the files again in this folder including "h".when i again double-clicked "h" it took me to same folder which contained all files including "h".I didn't remember about symbolic links and instantly I was worried that there is some virus in my system.I had heard earlier that there is a virus which creates a folder in each folder including itself.

after some days when I opened shell and typed ls -l, I found "h" showing l which means it's a link only.then i was relieved and deleted this. then I typed ln -s /home/gaurav/videos/jal.mp4 /home/gaurav/Desktop/jal. by this I am able to view this video directly through desktop. I need not go anywhere.and this is done without copying the video or without "cut and paste" from its original destination.

this was a new thing for me.so, I thought it would be good to share this.May be someone new like me would get help from this.But , if you are master of shell, you may laugh at me.


thanks everybody to read this post.

2 comments: