LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 07-22-2004, 02:55 AM   #1
foo_mulan
LQ Newbie
 
Registered: Jul 2004
Location: Malaysia
Posts: 11

Rep: Reputation: 0
Understanding shell


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.

#cd /etc/rc3.d
#ln -s ../init.d/mysql S85mysql
#ln -s ../init.d/mysql K85mysql
#cd /etc/rc5.d
#ln -s ../init.d/mysql S85mysql
#ln -s ../init.d/mysql K85mysql
#cd ../init.d
#chmod 755 mysql

Thank you very much.
 
Old 07-22-2004, 03:16 AM   #2
Ztyx
Member
 
Registered: Dec 2001
Location: Stockholm, Sweden
Distribution: Ubuntu, Kubuntu and Debian
Posts: 338

Rep: Reputation: 30
Have a look at
Code:
# man ln
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'.

For chmod yoiu can have a look at this homepage:
http://catcode.com/teachmod/

Regards,

Jens

Last edited by Ztyx; 07-22-2004 at 03:21 AM.
 
Old 07-22-2004, 09:23 AM   #3
AnanthaP
Member
 
Registered: Jul 2004
Location: Chennai, India
Distribution: UBUNTU 5.10 since Jul-18,2006 on Intel 820 DC
Posts: 832

Rep: Reputation: 200Reputation: 200Reputation: 200
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.

End
 
Old 07-23-2004, 02:36 PM   #4
Ztyx
Member
 
Registered: Dec 2001
Location: Stockholm, Sweden
Distribution: Ubuntu, Kubuntu and Debian
Posts: 338

Rep: Reputation: 30
Quote:
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.

Ciao,

/J
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
help understanding ln dr_zayus69 Linux - General 3 01-14-2005 08:33 PM
A better understanding! nny0000 Slackware 1 04-14-2004 12:01 PM
Understanding X?? ++ bdp Linux - General 2 02-25-2004 05:47 PM
Understanding X?? nny0000 Linux - General 2 02-25-2004 02:07 AM
Understanding df -k itsjustme Linux - General 6 10-28-2003 12:08 PM


All times are GMT -5. The time now is 08:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration