LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-30-2010, 01:51 PM   #1
deuberger
LQ Newbie
 
Registered: Sep 2010
Posts: 4

Rep: Reputation: 0
symlink redirect


Hi is there a way to make a symlink that redirects to the directory rather than acting as an alternate path? In other word, what I have now is:

Code:
$ ln -s -T /some/directory somelink
$ cd somelink
$ pwd
/home/myusername/somelink
but what I want is something like:

Code:
$ ln -s -T /some/directory somelink
$ cd somelink
$ pwd
/some/directory
Does that make sense? I want my pwd to be the hardlink pwd rather than the symlink pwd after changing my directory. Ideas?
 
Old 09-30-2010, 02:11 PM   #2
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,281

Rep: Reputation: 320Reputation: 320Reputation: 320Reputation: 320
I think it's not possible with symlinks, but you can do:
Code:
cd -P somelink
to really go where symlink point.
 
Old 10-01-2010, 08:40 AM   #3
deuberger
LQ Newbie
 
Registered: Sep 2010
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by eSelix View Post
I think it's not possible with symlinks, but you can do:
Code:
cd -P somelink
to really go where symlink point.
Ah, that's a almost satisfactory solution. It will probably be the best we can get. I also noticed that you can do:

Code:
set -P
Which will make cd -P the default in essence (see the bash man pages).

Thanks!
 
  


Reply

Tags
link, ln, symlink


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Would a symlink help ? budword Linux - Software 4 07-11-2007 12:47 PM
Symlink Fredde87 Linux - General 14 09-30-2005 08:06 PM
where is symlink? guitarfella Slackware 3 12-04-2004 07:34 AM
symlink mikedelo Linux - Software 2 03-28-2004 12:32 PM
Symlink Mestax Linux - Newbie 3 09-04-2003 12:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:42 AM.

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