LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   problem using ln with command line (https://www.linuxquestions.org/questions/linux-newbie-8/problem-using-ln-with-command-line-189191/)

lex 06-03-2004 06:21 AM

problem using ln with command line
 
I'm trying to create a symbolic link using ln. I used ln as per the man page, it creates the link and show up when I look in the directory, BUT when I try to change dir, it comes up with "bash: cd: linux: No such file or directory". When I look at the file structure in Konqueror, it shows the link name but the file type is unknown and has 0 bytes. When I was last mucking around with mdk 9.2 I'm sure the link showned up as a folder? I What am I doing wrong.
:scratch:

hw-tph 06-03-2004 06:29 AM

The basic usage (for symbolic links) is: ln -s <original> <new_link> or to give a real-world example: ln -s /usr/src/linux-2.6.6-mm1 /usr/src/linux to create a link in /usr/src called "linux" and pointing to the /usr/src/linux-2.6.6-mm1 directory.

Also, if you want to make a quick link with the same name as the original file or directory in your current working directory you could just type ln -s <target>.

The most probable cause in your case is that you simply created the link wrong. Did you test it in the console? Type ls -l <link> to see where a link points to. Example:
Code:

hw@baron:~$ cd /usr/src
hw@baron:/usr/src$ ls -l linux
lrwxrwxrwx  1 root root 23 Jun  2 20:51 linux -> linux-2.6.6-mm1/

Note the "linux -> bleh" which shows what the "linux" symbolix link points to, in this case to linux-2.6.6-mm1 in the same directory.



Håkan

lex 06-03-2004 07:10 AM

I've tried
"ln -s linux2.6.6mod linux" and got "lrwxrwxrwx 1 root root 13 Apr 19 21:39 linux -> linux2.6.6mod", then I tried "ln -s linux2.6.6mod/ linux" and got "lrwxrwxrwx 1 root root 14 Apr 19 21:40 linux -> linux2.6.6mod/", neither worked. I also tried the full directories like "ln -s /usr/src/linux2.6.6mod/ /usr/src/linux" and it still doesn't work. Any idea's.

samills70 06-03-2004 07:22 AM

Reply
 
Let me just start off by saying I'm a newbie but maybe this will point you in the right direction. I also had a problem with a file like that while installing qmail. I don't think your link is the problem and the reason you are an error is because the file hasn't been converted to an executable format yet. When I was intalling Qmail I found that after I typed in a command it didn't work. I used the "file" command to find out what it was and it wasn't recognised. I realised that I had missed the "make && make install" command so that the file was just a dormant file and hadn't been compiled yet (if compiled is the right terminology for this process).

Hope this helps.

lex 06-03-2004 07:43 AM

Thanks hw-tph. I mucked around a bit more and now it work, Newbie error.


All times are GMT -5. The time now is 03:00 AM.