The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

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 11:06 AM
Remove contents of directory, but not directory pdc Shell Programming and Scripting 8 12-04-2005 09:57 AM
fastest way to remove duplicates. radhika Shell Programming and Scripting 15 11-03-2005 03:27 AM
smitty, remove user, remove directory as well.. yls177 UNIX for Dummies Questions & Answers 2 11-10-2002 10:43 PM
remove a nonempty directory babayeve UNIX for Dummies Questions & Answers 2 08-26-2002 08:34 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-07-2006
Registered User
 

Join Date: Jan 2006
Posts: 72
how to delete/remove directory in fastest way

hello

i need help to remove directory . The directory is not empty ., it contains
several sub directories and files inside that..

total number of files in one directory is 12,24,446 .

rm -rf doesnt work . it is prompting for every file ..

i want to delete without prompting and fast way..

directory name is
2005-12-27
inside that
so different directories arethee

rm -rf 2005-12-27 .. ( it didnt work

pls suggest me .. or another fast way to delete the directory
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 03-07-2006
vino's Avatar
Supporter (in vino veritas)
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,643
Your rm could be alias'ed. Try this.

unalias rm
rm -rf /dir/to/delete
Reply With Quote
  #3 (permalink)  
Old 03-07-2006
Registered User
 

Join Date: Jan 2006
Posts: 72
it is very slow and taking time to delete ..

anyother fast way to delete/remove

thanks vino
Reply With Quote
  #4 (permalink)  
Old 03-07-2006
Just Ice's Avatar
Lights on, brain off.
 

Join Date: Mar 2005
Location: in front of my computer
Posts: 627
if the directory is in it's own filesystem --- unmount, newfs, and remount the filesystem ...
Reply With Quote
  #5 (permalink)  
Old 03-07-2006
Technorati Master
 

Join Date: Mar 2005
Location: Large scale systems...
Posts: 2,472
Quote:
Originally Posted by vino
Your rm could be alias'ed. Try this.

unalias rm
rm -rf /dir/to/delete
aliasing could have been done, for some purpose
i dont think unaliasing and using the command as a valid one.

instead use,
/bin/rm -rf /dir/to/delete
or
/usr/bin/rm -rf /dir/to/delete

aliasing would be preserved.
Reply With Quote
  #6 (permalink)  
Old 03-07-2006
vino's Avatar
Supporter (in vino veritas)
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,643
Quote:
Originally Posted by matrixmadhan
aliasing could have been done, for some purpose
i dont think unaliasing and using the command as a valid one.

instead use,
/bin/rm -rf /dir/to/delete
or
/usr/bin/rm -rf /dir/to/delete

aliasing would be preserved.
Very true. Deleting over a million files, wouldnt be a novice's job. You would be very aware of what you are doing.
Reply With Quote
  #7 (permalink)  
Old 03-07-2006
Technorati Master
 

Join Date: Mar 2005
Location: Large scale systems...
Posts: 2,472
Quote:
You would be very aware of what you are doing.
i think I have miscommunicated somewhere ...

using /bin/rm or /usr/bin/rm will not prompt while deleting each of the file
unlike the alias that was set for rm.

so using the above would preserve aliasing done before as well as it wont prompt while deleting file.

Sorry, if I am churning out the same thing.
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




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