Changing behavior of pwd with symlinks
Quick question - is there a way to force pwd to show the full path name even after you've followed a symlink?
i.e. when I do: laura@cleopatra:~$ ln -s /home/laura/Download/whale-0.2 ./WHALE laura@cleopatra:~$ cd WHALE laura@cleopatra:~/WHALE$ pwd /home/laura/WHALE laura@cleopatra:~/WHALE$ As it is, pwd is rendered rather useless...I know what symlink I followed, what I want to know is what directory I'm in. I'd rather pwd output "/home/laura/Download/whale-0.2." Does anyknow know if there's a way to do this? Thanks! -Laura |
readlink -f `pwd`
if you want it to be generally applicable, something like if [ -L `pwd` ]; then readlink -f `pwd`; else pwd; fi But why does it matter? Wherever you go, there you are. |
wunderbar :-) thanks!
And mainly because I'm inordinately fond of doing things like "cd ../../../Documents/blah/foo/bar" ;) |
All times are GMT -5. The time now is 01:32 PM. |