unix - linux: what is the difference between these two symbolic link commands -


i trying create symbolic link on server command ln -s,

option 1:

ln -s /home/thejobco/public_html/jccore/ajax_search /home/thejobco/public_html/demo/typo3conf/ext/

result 1:

ajax_search -> /home/thejobco/public_html/jccore/ajax_search

option 2:

ln -s /home/thejobco/public_html/jccore/ajax_search/ /home/thejobco/public_html/demo/typo3conf/ext/

result 2:

ajax_search -> /home/thejobco/public_html/jccore/ajax_search/

question:

i want know if above 2 options same, or there different between them? option 1 not have /, option 2 has /, both of them work well, wonder standard way?

a symbolic link implemented file containing name of target.

there minor difference, you've seen: 1 of symlinks has trailing /, , other doesn't. can see difference in output of ls -l; on lower level, shows difference in path returned readlink() system call.

but there should no functional difference between them -- long target directory. either can used access linked directory.

for target that's not directory, this:

ln -s /etc/motd good_link ln -s /etc/motd/ bad_link 

will result in good_link being valid way access /etc/motd, , bad_link resulting in not directory error.


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

.htaccess - Matching full URL in RewriteCond -