how to delete/remove directory in fastest way | Unix Linux Forums | Shell Programming and Scripting

  Go Back    


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

how to delete/remove directory in fastest way

Shell Programming and Scripting


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 03-07-2006
getdpg getdpg is offline
Registered User
 
Join Date: Jan 2006
Last Activity: 10 June 2007, 5:34 AM EDT
Posts: 72
Thanks: 0
Thanked 0 Times in 0 Posts
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
Sponsored Links
    #2  
Old 03-07-2006
vino's Avatar
vino vino is offline Forum Advisor  
Supporter (in vino veritas)
 
Join Date: Feb 2005
Last Activity: 9 April 2013, 8:19 AM EDT
Location: Sydney, Down Under
Posts: 2,847
Thanks: 0
Thanked 12 Times in 12 Posts
Your rm could be alias'ed. Try this.

unalias rm
rm -rf /dir/to/delete
Sponsored Links
    #3  
Old 03-07-2006
getdpg getdpg is offline
Registered User
 
Join Date: Jan 2006
Last Activity: 10 June 2007, 5:34 AM EDT
Posts: 72
Thanks: 0
Thanked 0 Times in 0 Posts
it is very slow and taking time to delete ..

anyother fast way to delete/remove

thanks vino
    #4  
Old 03-07-2006
Just Ice's Avatar
Just Ice Just Ice is offline Forum Advisor  
Lights on, brain off.
 
Join Date: Mar 2005
Last Activity: 20 September 2013, 10:59 AM EDT
Location: Philadelphia metro
Posts: 958
Thanks: 3
Thanked 66 Times in 59 Posts
if the directory is in it's own filesystem --- unmount, newfs, and remount the filesystem ...
Sponsored Links
    #5  
Old 03-07-2006
matrixmadhan matrixmadhan is offline Forum Advisor  
Technorati Master
 
Join Date: Mar 2005
Last Activity: 11 April 2014, 1:02 AM EDT
Location: classification algos
Posts: 3,203
Thanks: 19
Thanked 30 Times in 27 Posts
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.
Sponsored Links
    #6  
Old 03-07-2006
vino's Avatar
vino vino is offline Forum Advisor  
Supporter (in vino veritas)
 
Join Date: Feb 2005
Last Activity: 9 April 2013, 8:19 AM EDT
Location: Sydney, Down Under
Posts: 2,847
Thanks: 0
Thanked 12 Times in 12 Posts
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.
Sponsored Links
    #7  
Old 03-07-2006
matrixmadhan matrixmadhan is offline Forum Advisor  
Technorati Master
 
Join Date: Mar 2005
Last Activity: 11 April 2014, 1:02 AM EDT
Location: classification algos
Posts: 3,203
Thanks: 19
Thanked 30 Times in 27 Posts
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.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Fastest way to delete duplicates from a large filelist..... Bashingaway Shell Programming and Scripting 4 07-08-2011 05:38 PM
Fastest way to count big amount of files in sub directory ngaisteve1 AIX 9 08-10-2010 12:32 AM
Fastest way to delete line johnbach Shell Programming and Scripting 1 04-08-2010 01:59 AM
fastest way to remove duplicates. radhika Shell Programming and Scripting 15 11-03-2005 06:27 AM
smitty, remove user, remove directory as well.. yls177 UNIX for Dummies Questions & Answers 2 11-11-2002 01:43 AM



All times are GMT -4. The time now is 02:13 PM.