What are these symbolic links actually? As I was reading through a book for the Linux+ certification, it is stated that the executable for the vi editor is actually placed under the /bin directory and a symbolic link is located under /usr/bin/ directory which in turn points to the executable located under /bin? What does this symbolic link mean?
SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
symbolic links in UNIX/Linux work basically like shortcuts in Windows. You can create an alias for a file or directory at a different location instead of creating a physical copy of the file or directory. For your example this means that you only have to maintain one copy of the vim executable but the use can find vim in both mentioned directories because the second one is a link to the first one ;-)
No, they don't work like .lnk-Files in Windows. (or is "shortcut" something new?)
a) Are symbolic links older than Windows-links, so if at all Windowslinks work like the unix ones. But they don't. b) A windows-link is a file which contains the information to where it links, while symbolic links on linux are a concept of the filesystem.
If you copy a symbolic link on windows to your USB-Stick, and try to use it later, you will be frustrated - it is just the .lnk-File, not the file it should link to.
The linux/unix link is much more useful, i.E. the link behaves as if it where the original file. It just doesn't consume the diskspace - it's like a reference or an pointer to an somewhere else specified object.
No, with shortcuts I meant the same as .lnk files. Not sure how they are called in English but I think it was shortcut.
And sorry for not going into details for the sake of an easy to understand answer. Of course symbolic links in UNIX are not the same as those Windows shortcuts because the whole organization of the file system works differently. I just said they basically work like the said shortcuts. I know that a lot of Linux commands let you choose if a symbolic link itself is copied/moved/etc. or the file it references, but I thought these details wouldn't make it easier for Jothi to understand what symbolic links are. Everyone working with Linux will soon realize that there are many more things regarding the file system which work different than on Windows.
Although I'm aware of the fact that UNIX-like systems were there long before Windows was invented. In fact it's interesting how many internal concepts in a modern Windows OS are very similar to those that have been used in UNIX systems many years before.
There are 2 ways that symbolic links are useful in Linux (and the other *n*x OS's) for executing programs.
1. As a simple alias. For example, people are used to invoking "vi", but there are actually a number of vi-like editors out there. Often the "vi" on a Linux system is really vim. But since "vi" is the generic name, it makes life (and how-to books) easier to alias "vi" to be a shortcut to starting vim. A lot of people don't even realize they're not really runnin vi until they encounter a system where "vi" brings up the real vi. Likewise, some systems allow you to invoke Perl as either /usr/bin/perl or /bin/perl.
2. As a convenience feature. A good example is the ldapmodify prorgam. It has an alias of "ldapadd". When you run this utility, the startup code looks at the name you used. If you started it using the "ldapadd" name, the add mode features are automatically switched on.
Perhaps the most extreme example of aliasing is the BusyBox utility. BusyBox is an all-in-one program that provides the basic functions of a host of Unix utilities. It's intended for use in settting up minimal systems where disk space may be limited, and it allows you to install them all by copying a single file. A lot of Unix utilities have common functionalities, so you can save significantly by only having one copy of them.
So when you invoke grep, you run BusyBox and it runs its grep utility. Invoke it from the sed alias, you get sed, and so forth.
An IDE is no substitute for an Intelligent Developer.