LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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-07-2007, 01:24 AM   #1
sudevank
LQ Newbie
 
Registered: Mar 2007
Posts: 27

Rep: Reputation: 15
Deleting soft link to directory


Hi all,
have a nice day...!
anybody know how to delete the softlink to a directory with out removing the directory itself.

regards
-sudevan
 
Old 03-07-2007, 02:22 AM   #2
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Just use "rm link name"? Seems to work fine for me.
 
Old 03-07-2007, 04:56 AM   #3
sudevank
LQ Newbie
 
Registered: Mar 2007
Posts: 27

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by Nylex
Just use "rm link name"? Seems to work fine for me.
Quoting what i tried in my RH9 m/c

[sudevan@pele-2 tmp]$ mkdir test
[sudevan@pele-2 tmp]$ ln -s test linktest
[sudevan@pele-2 tmp]$ ls -lcrt
total 4
drwxrwxr-x 2 sudevan sudevan 4096 Mar 7 16:22 test
lrwxrwxrwx 1 sudevan sudevan 4 Mar 7 16:22 linktest -> test
[sudevan@pele-2 tmp]$ rm linktest/
rm: cannot remove `linktest/': Not a directory
[sudevan@pele-2 tmp]$ rm link linktest/
rm: cannot remove `link': No such file or directory
rm: cannot remove `linktest/': Not a directory
rm: cannot remove `llink': No such file or directory
[sudevan@pele-2 tmp]$ rm link test
rm: cannot remove `link': No such file or directory
rm: cannot remove `test': Is a directory
[sudevan@pele-2 tmp]$
 
Old 03-07-2007, 05:32 AM   #4
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
rm link linktest
 
Old 03-07-2007, 07:44 AM   #5
Tortanick
Member
 
Registered: Jul 2006
Distribution: Debian Testing
Posts: 299

Rep: Reputation: 30
try rmdir linktest?
 
Old 03-07-2007, 11:09 AM   #6
iamnothere
Member
 
Registered: Feb 2007
Location: UK
Distribution: Slamd 64, Slackware
Posts: 46

Rep: Reputation: 16
The correct command is 'rm linktest'. Note, no trailing slash. When you add the trailing slash, it tries to descend into the directory instead of acting on the link itself.
 
1 members found this post helpful.
Old 03-07-2007, 10:56 PM   #7
sudevank
LQ Newbie
 
Registered: Mar 2007
Posts: 27

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by iamnothere
The correct command is 'rm linktest'. Note, no trailing slash. When you add the trailing slash, it tries to descend into the directory instead of acting on the link itself.
Hi thats work fine. the problem is we use 'TAB' forauto complete thats why appending '/' happening. Thanks a lot
 
  


Reply



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
Difference Between Soft Link & Hard Link rajaniyer123 Solaris / OpenSolaris 16 09-30-2012 03:42 AM
Soft Link and Hard Link Moataz Red Hat 1 04-25-2005 06:30 AM
Will soft link work? zulu1_hl Linux - Newbie 1 02-26-2003 02:39 PM
deleting orphan files and creating soft links cuss Linux - General 6 02-24-2003 09:43 AM
Soft link help Pyroknight Linux - Newbie 1 02-06-2003 06:21 PM

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

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