Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi! I was looking at a manual on how to install Apache, MySQL and PHP on Linux. Can someone explain to me what these lines mean? I would like to further understand the commands.
The command 'ln' is used to create a symlink. A symlink is somewhat what in windows is called a 'shortcut'. The '-s' flag creates a soft symlink, which is normally what you use when you want to create one.
The command
Code:
#ln -s ../init.d/mysql S85mysql
creates a symlink called 'S85mysql' (put into the '/etc/rc5.d' folder) which is refering to the actual file '../init.d/mysql'.
Actually, the "link" command is far superior to a "shortcut". It actually creates a second entry in the directory entry with the same "-i-node" (pointer to the file). So while changes in one file get reflected in the linked one also (as you might expect), when you are done with the fisrt entry, you can delete it while the file would still exist under the second name. In the case of a 'shortcut", the shortcut would cease to work.
All Unixes (includiing Linux) have various run levels. 0 - single user to 5 (GUI - I think). The parameters in /etc/rc?.d (? ranging from 2 to 5), contain the parameters that will be used to rebuild the "kernel".
Unlike DOS, which relies on the extension (like EXE, COM, pdf, doc) to tell the nature of the file, Unix relies on the permission "mode" thus "chmod" for change mode.
Originally posted by AnanthaP Actually, the "link" command is far superior to a "shortcut". It actually creates a second entry in the directory entry with the same "-i-node" (pointer to the file). So while changes in one file get reflected in the linked one also (as you might expect), when you are done with the fisrt entry, you can delete it while the file would still exist under the second name. In the case of a 'shortcut", the shortcut would cease to work.
...now I got curious here. What you are talking about is a hard symlink aren't you? His example were creating soft symlinks. There is a difference. A hard link can only refer to a file on the same partition since it points to a certain i-node and also increments a counter so that the fs knows that there are actually two file pointing at the same segment on i.e. a haddrive. That way when one of the files are removed it knows that there is still another file pointing at the segment.
But the thing is that a soft symlink is created more like in windows (apart from as you said that it's not a file - the referens to the file it's pointing to is saved in the directory file instead) - it is just a plain file which is pointing to a location in the UNIX filesystem i.e.
'/etc/lilo.conf'. That is why a soft link stops to work after you've removed the file they are pointing to.
For a newbie I normally skip the hard link discussions, because usually the soft ones works perfectly thrueout the systems because most knows that if you delete source file the symlink stops to work and that's the only problem. Hardlinks are more important if one is working with links to library files or big very important files...in my opinion.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.