The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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
remove old files from a directory 2davidc8 UNIX for Dummies Questions & Answers 2 07-03-2007 02:06 PM
Find all files created by a specified user in a directory and its subdirectories abhilashnair UNIX for Dummies Questions & Answers 5 06-13-2007 02:37 AM
searching files through all subdirectories beneath the current directory milagros Shell Programming and Scripting 5 05-15-2007 04:00 PM
list largest files in a directory & its subdirectories igidttam UNIX for Dummies Questions & Answers 6 09-25-2006 11:31 AM
How to Remove Ctrl M characters in files from directories and its subdirectories skdp Shell Programming and Scripting 7 07-29-2006 11:53 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-21-2007
ppa108 ppa108 is offline
Registered User
  
 

Join Date: May 2007
Posts: 14
How to remove directory with subdirectories and files?

I'm trying to remove several directories which contains sun-dirs and files inside.
I used the command rm -r <dirname>
But, it always ask "examine file in directory <dirname> yes/no?" line by line.
So, i need to write "y" for every line.
How can i skip this step and remove all directories with asking confirmation?
Thank you.
  #2 (permalink)  
Old 05-21-2007
encrypted's Avatar
encrypted encrypted is offline Forum Advisor  
Registered User
  
 

Join Date: Feb 2004
Location: Oslo, Norway
Posts: 219
\rm -rf <directory_name>
  #3 (permalink)  
Old 05-21-2007
the_learner the_learner is offline
Registered User
  
 

Join Date: Apr 2007
Posts: 75
I have a similar problem. I have a directory with *LOTS* of hidden files (beginning with a . )

In this case when I use rm -rf, I get the error:

rm: Unable to remove directory dir0: File exists

The thing is, I do not know where did all those files come from.. I think I did an nfs mount and something went wrong.. and these random files keep getting produced

-rwxrwxrwx 1 root engr 8192 May 5 20:35 .nfsD355*
-rwxrwxrwx 1 root engr 8192 May 5 20:35 .nfsD455*
-rwxrwxrwx 1 root engr 8192 May 5 20:35 .nfsD845*
-rwxrwxrwx 1 root engr 8192 May 5 20:35 .nfsD945*
-rwxrwxrwx 1 root engr 8192 May 5 20:35 .nfsDA45*
-rwxrwxrwx 1 root engr 8192 May 5 20:35 .nfsDB45*
-rwxrwxrwx 1 root engr 8192 May 5 20:35 .nfsDC45*
-rwxrwxrwx 1 root engr 8192 May 5 20:35 .nfsDD45*
-rwxrwxrwx 1 root engr 8192 May 5 20:35 .nfsDE45*
-rwxrwxrwx 1 root engr 8192 May 5 20:35 .nfsDF45*
-rwxrwxrwx 1 root engr 8192 May 5 20:35 .nfsE055*
-rwxrwxrwx 1 root engr 8192 May 5 20:35 .nfsE155*
-rwxrwxrwx 1 root engr 8192 May 5 20:35 .nfsE255*
-rwxrwxrwx 1 root engr 8192 May 5 20:35 .nfsE355*
-rwxrwxrwx 1 root engr 8192 May 5 20:35 .nfsE455*
-rwxrwxrwx 1 root engr 8192 May 5 20:35 .nfsE845*
-rwxrwxrwx 1 root engr 8192 May 5 20:35 .nfsE945*
-rwxrwxrwx 1 root engr 8192 May 5 20:35 .nfsEA45*
-rwxrwxrwx 1 root engr 8192 May 5 20:35 .nfsEB45*
-rwxrwxrwx 1 root engr 8192 May 5 20:35 .nfsEC45*
-rwxrwxrwx 1 root engr 8192 May 5 20:35 .nfsED45*
-rwxrwxrwx 1 root engr 8192 May 5 20:35 .nfsEE45*
-rwxrwxrwx 1 root engr 8192 May 5 20:35 .nfsEF45*


even in dir0, rm .nfs* does not work.
  #4 (permalink)  
Old 05-30-2007
ppa108 ppa108 is offline
Registered User
  
 

Join Date: May 2007
Posts: 14
I'm sorry to say that the suggestion from "encrypted" really doesn't work.
  #5 (permalink)  
Old 05-30-2007
milhan milhan is offline
Registered User
  
 

Join Date: Oct 2002
Location: /home
Posts: 133
Quote:
Originally Posted by the_learner
I have a similar problem. I have a directory with *LOTS* of hidden files (beginning with a . )

In this case when I use rm -rf, I get the error:

rm: Unable to remove directory dir0: File exists

even in dir0, rm .nfs* does not work.
are you sure you have the necessary permissions to operate inside the directory?

typically, rm -rf dir0 should work, even if there are hidden files inside dir0, as long as you have permissions to erase files in the current directory.
  #6 (permalink)  
Old 06-12-2007
ppa108 ppa108 is offline
Registered User
  
 

Join Date: May 2007
Posts: 14
rm -rf

I have all necessary permission. But i tried with rm -rf <dirname>, i got the following message.

rm: examine files in directory BioDiversity (yes/no)?

How to skip that questions?
  #7 (permalink)  
Old 06-13-2007
encrypted's Avatar
encrypted encrypted is offline Forum Advisor  
Registered User
  
 

Join Date: Feb 2004
Location: Oslo, Norway
Posts: 219
As stated previously, use the "\" before rm -rf <directory_name>
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 10:37 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0