Results 1 to 3 of 3

Thread: Deleting files Recursively

  1. #1

    Deleting files Recursively

    Hello,

    I have GB's of files & directories inside a folder, rm-rf * consumes plenty of time and results in error.
    Does anyone know if there is any method / command to delete all the files completely in short period of time ??

  2. #2
    Mentor jro's Avatar
    Join Date
    May 2004
    Location
    Pennsylvania, USA
    Posts
    1,206
    Ehh, rm -rf is pretty much your best bet. What error are you encountering?

    Two things you can try.
    If all your files you want deleted are in one directory, try rm -d This will unlink the directory, you need an older version of coretuils to do this however, I think it was removed in releases after 6.x. A caveat you are going to encounter with this method is all those files are going to end up in lost+found and will need to be cleaned up by an FSCK at some point.

    Second options, and probably not recommended, would be to nice the rm -rf process to a higher priority. Sure your system will probably become unresponsive until the delete is done, but it will most likely finish faster.

    Post the error you are getting and we can dig into it a bit..
    jro - http://jeff.robbins.ws
    Linux counter#:213782
    GnuPG ID: 406238E7

  3. #3
    Are you doing the removal as root?

    Another thing to look out for is immutable files. Not likely the case unless you've deliberately gone out of your way to do this. Run lsattr on the file giving you problems, look at the permissions.

Similar Threads

  1. Want a Deleting Script
    By bikram in forum Programming
    Replies: 2
    Last Post: 11-12-2007, 07:48 PM
  2. deleting old kernel
    By Dswissmiss in forum Linux - Software, Applications & Programming
    Replies: 11
    Last Post: 04-25-2004, 11:32 PM
  3. deleting groups
    By pinehead in forum Linux - General Topics
    Replies: 3
    Last Post: 02-25-2003, 01:43 AM
  4. deleting apache
    By JohanPe in forum Suse
    Replies: 3
    Last Post: 06-11-2002, 04:46 AM
  5. Deleting a thread
    By cloverm in forum Announcements and Suggestions
    Replies: 9
    Last Post: 12-27-2001, 11:27 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •