LinuxQuestions.org
Register a domain and help support LQ
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 01-06-2006, 08:38 AM   #1
supersucker
Member
 
Registered: Jul 2004
Location: Berlin
Distribution: fedora 3
Posts: 79

Rep: Reputation: 15
question about symbolic links


hi everybody,

i have a question concerning symbolic links:

i wanted to compile a new kernel, so i downloaded the sources and unpacked them.
after that i wanted to make a symbolic link linux to the new kernel source, so i did:

Code:
ln -s /usr/src/kernels/linux-2.6.15/ /usr/src/linux
then i did (in /usr/src/) a:

Code:
[root@supersucker src]# file linux
linux: symbolic link to `/usr/src/kernels/linux-2.6.15/'
ok, seemed to be ok...

then i did something else (burning cds and stuff like that) which had nothing to do with /usr/src...

then i did a

Code:
[root@supersucker src]# file linux
again, and surprise:

Code:
linux/: directory
??? how can this happen???

furthermore, if i do:

Code:
[root@supersucker /]# cd /usr/src/linux/
[root@supersucker linux]# pwd
/usr/src/linux
shouldnt pwd print /usr/src/kernels/linux-2.6.15/ ?

but ls -al says:

Code:
[root@supersucker src]# ls -al
total 32
drwxr-xr-x   4 root root 4096 Jan  6 14:07 .
drwxr-xr-x  15 root root 4096 Nov 19 21:25 ..
drwxr-xr-x   4 root root 4096 Jan  6 13:23 kernels
lrwxrwxrwx   1 root root   30 Jan  6 14:07 linux -> /usr/src/kernels/linux-2.6.15/
drwxr-xr-x   7 root root 4096 Nov 14 20:18 redhat

i cant even delete the ?symbolic link?

Code:
[root@supersucker src]# rm -f linux/
rm: cannot remove `linux/': Not a directory
i have to delete it via konqueror....

i dont get it, man ls says:

Code:
NAME
       ln - make links between files

SYNOPSIS
       ln [OPTION]... TARGET [LINK_NAME]
did i do something wrong?
can somebody explain this strange behaviour?

thx for every help...
 
Old 01-06-2006, 09:00 AM   #2
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 55
Quote:
Originally Posted by supersucker
hi everybody,


Code:
[root@supersucker src]# file linux
again, and surprise:

Code:
linux/: directory
??? how can this happen???
No, it is not possible, you have typed
Code:
file linux/
with the /
Quote:
furthermore, if i do:

Code:
[root@supersucker /]# cd /usr/src/linux/
[root@supersucker linux]# pwd
/usr/src/linux
shouldnt pwd print /usr/src/kernels/linux-2.6.15/ ?
no

And to delete a link, only issue a
Code:
rm linux
There is no directory linux/ , it is a link
 
Old 01-06-2006, 09:11 AM   #3
supersucker
Member
 
Registered: Jul 2004
Location: Berlin
Distribution: fedora 3
Posts: 79

Original Poster
Rep: Reputation: 15
argggghhh!!!

yeah, youre right....

Code:
file linux
and

Code:
file linux/
is not the same.........

thx!
 
Old 01-06-2006, 09:27 AM   #4
Thymox
Senior Member
 
Registered: Apr 2001
Location: Plymouth, England.
Distribution: Debian + Ubuntu
Posts: 4,358

Rep: Reputation: 57
You could also use:
Code:
unlink linux
instead of
Code:
rm linux
 
  


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
strange question regarding symbolic links and apache drisay Slackware 3 11-16-2004 12:14 PM
help with symbolic links sopiaz57 Linux - General 2 06-11-2004 07:17 PM
Symbolic Links Greg_courageous Linux - Newbie 1 05-10-2004 08:05 AM
Symbolic links bkmesenbrink Linux - Newbie 2 11-13-2002 12:54 PM
symbolic links winger Linux - General 5 04-06-2002 06:16 PM


All times are GMT -5. The time now is 06:51 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