LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices

Reply
 
Search this Thread
Old 08-17-2005, 03:42 AM   #1
dajomu
Member
 
Registered: Aug 2005
Posts: 31

Rep: Reputation: 15
Question Softlinks - cannot delete


This is the result from a posting I had on the Newbie forum, but I still don't have an answer. Maybe somone specialized in Red Hat would know what the problem could be?

I made a softlink "ln -s" from the directory /var/www/html/public_html --> /home/ddd/public_html
but now I want to delete public_html so I tried;

Code:
rmdir /var/www/html/public_html but I got the error:
rmdir: `public_html/': Not a directory
Then I tried;

Code:
rm -d /var/www/html/public_html but I got the error:
rm: cannot remove directory `public_html/': Is a directory
Any solutions out there?

DaJoMu


---------------------------------------------------------------

How exactly did you issue the
ln
?
And what does
ls -ld /var/www/html
have to say about it?


Cheers,
Tink

------------------------------------

I issued the softlink in this manner

Code:
ln -s /home/ddd/public_html /var/www/html/public_html


ls -ld /var/www/html/public_html  
drwxr-xr-x  2 ddd ddd 4096 Aug 15 19:49 /var/www/html/public_html/

Code:
ls -ld /var/www/html
drwxr-xr-x  5 root root 4096 Aug 15 20:18 /var/www/html/
yes, I am logged on as root.

-------------------------------------

How bizarre

That's an actual directory. And ln -s should have failed.

rm -rf /var/www/html/public_html
should work.


Cheers,
Tink

------------------------------------------------------

Not working ( post #5)

Code:
rm -rf /var/www/html/public_html/
rm: cannot remove `/var/www/html/public_html/': Not a directory
I could probably just leave it like this, but if anyone got
other suggestions that would be nice?

Let me say this is a Clarkconnect 3.1 server running Red Hat Enterprise Linux / CentOS 4 core

Code:
uname -a
Linux gateway.xxx.xxx  2.6.9-19.cc #1 Fri Jul 8 18:40:48 EDT 2005 i686 i686 i386 GNU/Linux
 
Old 08-17-2005, 04:03 AM   #2
spooon
Senior Member
 
Registered: Aug 2005
Posts: 1,755

Rep: Reputation: 48
Is there any difference between these two:
Code:
ls -l /var/www/html/public_html
ls -l /var/www/html/public_html/
(Note the lack of trailing slash in the first line; some shells may add or remove the trailing slash when completing, so pay attention.)
If it really is a symlink then the first should tell you about the symlink and the second should tell you about the directory it points to.

Also check
Code:
alias ls
to check if ls is aliased to have certain options. In particular, the options "-L" and "-p" may cause ls to follow the symlink.
 
Old 08-17-2005, 04:10 AM   #3
dajomu
Member
 
Registered: Aug 2005
Posts: 31

Original Poster
Rep: Reputation: 15
softlinks - cannot delete

Output from the suggested commands

Code:
ls -l /var/www/html/public_html
Shows where the symlink points to.

Code:
ls -l /var/www/html/public_html
lists out the content in /home/ddd/public_html

Code:
alias ls
alias ls='ls --color=tty'
Code:
alias -p ls
alias cp='cp -i'
alias l.='ls -d .* --color=tty'
alias ll='ls -l --color=tty'
alias ls='ls --color=tty'
alias mv='mv -i'
alias rm='rm -i'
alias which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde'
alias ls='ls --color=tty'
alias -L ls does not work

DaJoMu
 
Old 08-17-2005, 05:18 AM   #4
spooon
Senior Member
 
Registered: Aug 2005
Posts: 1,755

Rep: Reputation: 48
I don't know what to tell you, except just to do this again:
Code:
rm /var/www/html/public_html
amd make sure not to have a trailing slash.
 
Old 08-17-2005, 02:36 PM   #5
dajomu
Member
 
Registered: Aug 2005
Posts: 31

Original Poster
Rep: Reputation: 15
Genius!!

Thank you so very much Spoon. The solution was the trailing /
Since I used tab to finish the line the / always was present.

I learned something new today.

Thanks
 
  


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
How to delete files that won't delete? di11rod Linux - Security 7 10-19-2005 09:14 PM
Crappy softlinks dajomu Linux - Newbie 4 08-16-2005 03:50 PM
Tried to delete file as root but it says I don't have permission to delete it! beejayzed Mandriva 23 03-12-2004 02:46 AM
Proftpd + softlinks + no go? BlackRabbit Linux - Software 6 12-16-2003 08:20 AM
how to delete? RRMitsu Linux - General 1 12-26-2002 02:23 PM


All times are GMT -5. The time now is 12:15 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration