LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 11-16-2014, 02:28 PM   #1
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 789

Rep: Reputation: Disabled
Should symbolic link target directories have foward slash?


I created two symbolic links to "../application/lib/" (a folder). Both seem to work (Centos 6.6). Is one better than the other? If the same, is one more commonly used than the other? Thank you

Code:
ln -s ../application/lib/ lib
ln -s ../application/lib xxx

lrwxrwxrwx.  1 Michael Michael    19 Nov 16 12:18 lib -> ../application/lib/
lrwxrwxrwx.  1 Michael Michael    18 Nov 16 12:19 xxx -> ../application/lib
 
Old 11-16-2014, 02:35 PM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,879

Rep: Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317
I think the first one can only link to a dir, the second one can point to anything.
 
Old 11-16-2014, 02:42 PM   #3
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 789

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
I think the first one can only link to a dir, the second one can point to anything.
You appear to be correct. I was able to create a symbolic link to a file followed by a forwardslash, but couldn't follow it.

Should the forward slash be used when linking to a folder?
 
Old 11-16-2014, 03:12 PM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,879

Rep: Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317
You can test that too. It is not required, but you are allowed to do that.
 
Old 11-16-2014, 06:24 PM   #5
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 789

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
You can test that too. It is not required, but you are allowed to do that.
Thanks Pan, I had already tested it before posting my question, and see that it is allowed (at least on my distro). But is the "right" thing to do? And if it doesn't matter, what do the Linux guru's do. I figure I should at least be consistent, but need a direction to be consistent.
 
Old 11-17-2014, 12:09 AM   #6
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,879

Rep: Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317
I think most of them (gurus?) uses without that slash at the end, but there can be a reason to use it that way. But I have never met it.
 
Old 11-17-2014, 12:34 PM   #7
camelrider
Member
 
Registered: Apr 2003
Location: Juneau, Alaska
Posts: 251

Rep: Reputation: 32
Cool

If the target directory's parent contains a file with the same name as the target directory the forward slash will select the directory.
 
  


Reply



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
[SOLVED] removing symbolic link target bilyboy65 Linux - General 4 10-10-2012 12:25 PM
Symbolic link not allowed or link target not accessible rheluser Linux - Server 3 09-04-2012 10:22 AM
symbolic link not allowed or link target not accessible paullaubscher Linux - Newbie 4 03-10-2010 06:47 AM
Configure symbolic links to always append a slash sadarax Linux - General 3 10-30-2006 05:40 AM
Necessary trailing slash in apache directories silversky Linux - Software 3 03-03-2004 03:19 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:40 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
Open Source Consulting | Domain Registration