LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 06-03-2004, 07:21 AM   #1
lex
LQ Newbie
 
Registered: Aug 2003
Location: Australia
Distribution: Mandrake
Posts: 3

Rep: Reputation: 0
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.
 
Old 06-03-2004, 07:29 AM   #2
hw-tph
Senior Member
 
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032

Rep: Reputation: 58
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
 
Old 06-03-2004, 08:10 AM   #3
lex
LQ Newbie
 
Registered: Aug 2003
Location: Australia
Distribution: Mandrake
Posts: 3

Original Poster
Rep: Reputation: 0
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.
 
Old 06-03-2004, 08:22 AM   #4
samills70
Member
 
Registered: May 2004
Posts: 32

Rep: Reputation: 15
Exclamation 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.
 
Old 06-03-2004, 08:43 AM   #5
lex
LQ Newbie
 
Registered: Aug 2003
Location: Australia
Distribution: Mandrake
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks hw-tph. I mucked around a bit more and now it work, Newbie error.
 
  


Reply


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
command line problem elfowl MEPIS 9 06-05-2005 01:18 AM
Problem executing from command line jleyba213 Linux - General 4 04-09-2004 01:43 PM
Problem getting to command line... ChaosJunkee Mandriva 5 09-14-2003 06:26 PM
command line problem garth_s Linux - General 1 06-26-2003 03:12 PM
problem with command line prompt ??? robeb Linux - General 2 12-07-2002 09:47 PM


All times are GMT -5. The time now is 06:52 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration