Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Hey guys can you help me with some issues on how to navigate through links to the directory or file it points to through the command line?

If i try to 'cd' into them it says they are not directories which of course they aren't its just a file but I can click that file (some of them) in the file browser (not through terminal)

For example there is a .vim folder in my home directory which I cannot 'cd' into it also when you install Ubuntu there is a Examples folder on the desktop and a link to that from you home directory. I cannot navigate it through the command line.

I'm trying to install some vim plugins which should go into the .vim folder but it's not a folder...it's a file which I can open up in a text editor. However most sites say to put scripts in sub folders inside .vim folder... i'm really confused with this, any help? I can't do 'mkdir' either if i do 'mkdir .vim' it says directory already exists....

share|improve this question
    
what do you have in that .vim file? vim reads configuration from the file .vimrc, .vim should be a directory. I suggest you rename .vim to something else and create the directory .vim –  solarc Mar 19 '10 at 20:39
add comment

migrated from stackoverflow.com Nov 14 '09 at 20:52

This question came from our site for professional and enthusiast programmers.

1 Answer

If your symlink is named for example 'zapo':

  :cd `readlink zapo`

does what you want. The backticks tell vim to run that external program; man readlink explains the Unix readlink command.

share|improve this answer
    
thank you, i tried that it seems to work although it takes me back to my home directory and not the link. In ubuntu there is a Examples folder on the desktop with a link on the home directory. its called 'Examples' when viewing from the file browser but its called 'examples.desktop' when doing 'ls -al' I can click that on the file browser fine but if I do the above command it takes me back to my home directory –  iQ Nov 13 '09 at 23:09
    
So what does readlink examples.desktop say when you run it from a shell prompt? My ubuntu installation has no such symlink, so I can't check! –  Alex Martelli Nov 13 '09 at 23:11
    
If i do 'readlink examples.desktop' it doesn't do anything and if I do 'readling -e examples.desktop' it says /home/myuser/examples.desktop –  iQ Nov 13 '09 at 23:18
    
.desktop files are not symlinks. They are special files used by Gnome to launch programs (in this case Nautilus pointing to the Examples dir). You can't cd into it. –  solarc Mar 19 '10 at 20:43
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.