LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-04-2003, 01:56 PM   #1
cliffyman
Member
 
Registered: Aug 2001
Location: Buffalo, NY
Distribution: Red Hat
Posts: 83

Rep: Reputation: 15
RedHat 8.0 symbolic links?


Has anyone else noticed issues with RedHat 8.0's ln command to make symbolic links? Call me crazy, but when I do something simple like:

ln -s /usr/local/src /home/meyers

and then

rm /home/meyers

it tries to remove all the files and dirs within /usr/local/src ? When I do a ln -s on my RedHat 7.2 system and then remove the symbolic link, it removes it just like any other file.

Am I missing something - did something change here? Am I losing my mind?
 
Old 03-04-2003, 03:00 PM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 270Reputation: 270Reputation: 270
Something is wrong with your links then.

Have you tried going into your home directory and just issuing this:

rm meyers
 
Old 03-04-2003, 03:02 PM   #3
cliffyman
Member
 
Registered: Aug 2001
Location: Buffalo, NY
Distribution: Red Hat
Posts: 83

Original Poster
Rep: Reputation: 15
Any idea what's going on down below here? The /usr/local/src dir is owner root, group root, and chmoded 755.

Code:
[meyers@vanadium meyers]$ cd /home/meyers/
[meyers@vanadium meyers]$ ls -la
total 28
drwx------    3 meyers   meyers       4096 Mar  4 15:04 .
drwxr-xr-x    5 root     root         4096 Mar  2 09:37 ..
-rw-------    1 meyers   meyers        482 Mar  4 15:56 .bash_history
-rw-r--r--    1 meyers   meyers         24 Mar  2 09:37 .bash_logout
-rw-r--r--    1 meyers   meyers        191 Mar  2 09:37 .bash_profile
-rw-r--r--    1 meyers   meyers        124 Mar  2 09:37 .bashrc
drwxrwxr-x    3 meyers   meyers       4096 Mar  3 09:41 .cpan
[meyers@vanadium meyers]$ ln -s /usr/local/src/
[meyers@vanadium meyers]$ ls -la
total 28
drwx------    3 meyers   meyers       4096 Mar  4 16:10 .
drwxr-xr-x    5 root     root         4096 Mar  2 09:37 ..
-rw-------    1 meyers   meyers        482 Mar  4 15:56 .bash_history
-rw-r--r--    1 meyers   meyers         24 Mar  2 09:37 .bash_logout
-rw-r--r--    1 meyers   meyers        191 Mar  2 09:37 .bash_profile
-rw-r--r--    1 meyers   meyers        124 Mar  2 09:37 .bashrc
drwxrwxr-x    3 meyers   meyers       4096 Mar  3 09:41 .cpan
lrwxrwxrwx    1 meyers   meyers         15 Mar  4 16:10 src -> /usr/local/src/
[meyers@vanadium meyers]$ rm src/
rm: remove write-protected directory `src/'? y
rm: remove write-protected directory `src//apache_1.3.27'? n
rm: remove write-protected regular file `src//mod_perl-1.27/t/docs/subr/index.html'? n
rm: remove write-protected regular file `src//mod_perl-1.27/t/docs/test.shtml'? n
rm: remove write-protected regular file `src//mod_perl-1.27/t/docs/blib.pl'? 
[meyers@vanadium meyers]$

Last edited by cliffyman; 03-04-2003 at 03:05 PM.
 
Old 03-04-2003, 03:21 PM   #4
nxny
Member
 
Registered: May 2002
Location: AK - The last frontier.
Distribution: Red Hat 8.0, Slackware 8.1, Knoppix 3.7, Lunar 1.3, Sorcerer
Posts: 771

Rep: Reputation: 30
What is rm aliased as for your root environment?

Have you tried rm src instead of rm src/ ?
 
Old 03-04-2003, 03:31 PM   #5
cliffyman
Member
 
Registered: Aug 2001
Location: Buffalo, NY
Distribution: Red Hat
Posts: 83

Original Poster
Rep: Reputation: 15
Your second suggestion hit the nail on the head - rm src works kills the soft link as expected but rm src/ for some reason tries to kill the linked directory itself. In RedHat 7.2, rm src and rm src/ do the exact same thing.

Thanks again everyone for the help with this stupid question.
 
Old 03-04-2003, 04:04 PM   #6
nxny
Member
 
Registered: May 2002
Location: AK - The last frontier.
Distribution: Red Hat 8.0, Slackware 8.1, Knoppix 3.7, Lunar 1.3, Sorcerer
Posts: 771

Rep: Reputation: 30
I wouldnt blame it on RH version difference. What version of fileutils ( of which rm is a part ) are you using? Try
rm --version
in both environments and post.

Again, do
alias | grep rm
in both environments.

Curious!!!!
 
Old 03-04-2003, 11:40 PM   #7
cliffyman
Member
 
Registered: Aug 2001
Location: Buffalo, NY
Distribution: Red Hat
Posts: 83

Original Poster
Rep: Reputation: 15
RH 7.2 uses fileutils version 4.1 and RH 8.0 uses fileutils version 4.1.9
 
Old 03-04-2003, 11:59 PM   #8
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 270Reputation: 270Reputation: 270
Well most likely when your trying to rm like:

rm src/

Then it reads it like a directory I would presume for some reason. Links are just files, so when deleting them, you don't need to put the / at the end, just rm the actual filename in your case.

But testing on my Slack box, it worked both ways for me with no problems. And the version I have is 4.1
 
Old 03-05-2003, 07:06 AM   #9
cliffyman
Member
 
Registered: Aug 2001
Location: Buffalo, NY
Distribution: Red Hat
Posts: 83

Original Poster
Rep: Reputation: 15
Right, and it works fine on RedHat 7.2 and that uses fileutils 4.1 also - something changed in 4.1.9. Thanks for help clearing up the mystery folks!
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
cp and symbolic links? sausagejohnson Linux - General 3 07-19-2005 01:25 AM
Symbolic Links petercool Linux - General 2 08-20-2003 11:15 AM
Symbolic links pdstatha Programming 1 04-08-2002 09:50 PM
symbolic links winger Linux - General 5 04-06-2002 05:16 PM
symbolic links NoahsMyBro Linux - Newbie 1 11-16-2001 11:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:46 PM.

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
Open Source Consulting | Domain Registration