The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
how unix called as secure sanjeev1 UNIX for Dummies Questions & Answers 5 06-18-2007 06:29 AM
Need help with ksh script that uses sqlplus, called from PHP j2owilson Shell Programming and Scripting 7 02-27-2006 12:35 PM
cpio in shell called from php mmarino Shell Programming and Scripting 3 10-07-2005 08:39 AM
Procedures are not called ? dreams5617 Shell Programming and Scripting 2 11-11-2004 04:02 PM
I tried to get the PID on the files called PID_Server hoang Shell Programming and Scripting 1 04-16-2002 11:46 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-12-2007
Registered User
 

Join Date: May 2004
Location: UK
Posts: 74
Stumble this Post!
Help I've created a dir called /

OK, I had some odd characters in my mkdir command which resulted in the following directory getting created:


drwxr-xr-x 2 fred fredgroup 512 Apr 12 16:52 /

Any ideas how I get rid of it safely?

Interestingly that's a straight cut'n'paste and there appear to be some odd characters before the /...

Thanks!
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 04-12-2007
reborg's Avatar
Administrator
 
Join Date: Mar 2005
Location: Ireland
Posts: 3,513
Stumble this Post!
Code:
rmdir '/'
Reply With Quote
  #3 (permalink)  
Old 04-16-2007
Registered User
 

Join Date: May 2004
Location: UK
Posts: 74
Stumble this Post!
Hi Reborg,

Just tried this but it keeps giving me a command continuation prompt ( > )

Is there a way of deleting files/directories via the inode?


Thanks, p.

Last edited by pondlife; 04-16-2007 at 01:43 AM.
Reply With Quote
  #4 (permalink)  
Old 04-25-2007
Registered User
 

Join Date: Mar 2007
Posts: 16
Stumble this Post!
Quote:
Originally Posted by pondlife
Hi Reborg,

Just tried this but it keeps giving me a command continuation prompt ( > )

Is there a way of deleting files/directories via the inode?


Thanks, p.
Yes, you should be able to remove a file using it's inode.

1. cd to the directory containing the file
2. ls -li (will provide inode numbers in the far left column)
3. find . -xdev -inum inode_number -exec rm {} \;
Reply With Quote
  #5 (permalink)  
Old 05-01-2007
kahuna's Avatar
Registered User
 

Join Date: Apr 2007
Posts: 148
Stumble this Post!
It may not be possible if the name contains a "/".
http://www.faqs.org/faqs/unix-faq/fa...section-2.html

But you could try the
Code:
rm -ri .
and answer "n" to everything but the problem directory/file.

Last edited by kahuna; 05-02-2007 at 04:21 AM. Reason: Additional thought.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 12:49 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0