All of lore.kernel.org
 help / color / mirror / Atom feed
* recursively removing directories
@ 2002-06-30  1:44 Matthew Stapleton
  2002-06-30  1:50 ` Joseph Jackson
  2002-06-30  8:26 ` Richard Adams
  0 siblings, 2 replies; 6+ messages in thread
From: Matthew Stapleton @ 2002-06-30  1:44 UTC (permalink / raw)
  To: linux-newbie

How do I recursively remove all the subdirectories and contents of a
particular directory in Linux? I know of 'rmdir', but this only works for
empty directories.  I need something like DOS's 'deltree'.

Thanks,
Matthew Stapleton
 
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: recursively removing directories
  2002-06-30  1:44 recursively removing directories Matthew Stapleton
@ 2002-06-30  1:50 ` Joseph Jackson
  2002-06-30  6:57   ` cr
  2002-06-30  8:26 ` Richard Adams
  1 sibling, 1 reply; 6+ messages in thread
From: Joseph Jackson @ 2002-06-30  1:50 UTC (permalink / raw)
  To: Matthew Stapleton; +Cc: linux-newbie

Matthew Stapleton wrote:

> How do I recursively remove all the subdirectories and contents of a
> particular directory in Linux? I know of 'rmdir', but this only works for
> empty directories.  I need something like DOS's 'deltree'.
> 
> Thanks,
> Matthew Stapleton
>  
> -
> To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.linux-learn.org/faqs
> 
> 

Like this rm -rf /whatever  the -r is ofcourse recursive and the -f is force is 
it won't ask you.

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: recursively removing directories
  2002-06-30  1:50 ` Joseph Jackson
@ 2002-06-30  6:57   ` cr
  0 siblings, 0 replies; 6+ messages in thread
From: cr @ 2002-06-30  6:57 UTC (permalink / raw)
  To: Joseph Jackson, Matthew Stapleton; +Cc: linux-newbie

On Sunday 30 June 2002 13:50, Joseph Jackson wrote:
> Matthew Stapleton wrote:
> > How do I recursively remove all the subdirectories and contents of a
> > particular directory in Linux? I know of 'rmdir', but this only works for
> > empty directories.  I need something like DOS's 'deltree'.
> >
> > Thanks,
> > Matthew Stapleton
> >
>
> Like this rm -rf /whatever  the -r is ofcourse recursive and the -f is
> force is it won't ask you.
>

... and be VERY CAREFUL using it!!!!

(man rm   will give you the syntax).

cr
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: recursively removing directories
  2002-06-30  1:44 recursively removing directories Matthew Stapleton
  2002-06-30  1:50 ` Joseph Jackson
@ 2002-06-30  8:26 ` Richard Adams
  1 sibling, 0 replies; 6+ messages in thread
From: Richard Adams @ 2002-06-30  8:26 UTC (permalink / raw)
  To: Matthew Stapleton, linux-newbie

On Sunday 30 June 2002 01:44, Matthew Stapleton wrote:
> How do I recursively remove all the subdirectories and contents of a
> particular directory in Linux? I know of 'rmdir', but this only works for
> empty directories.  I need something like DOS's 'deltree'.

You got 2 other answers to your question, one mentioned the need to be "very 
carefull" with rm, what they did not say is you can wipe out your complete 
system with rm and its options.
I would strongly advise you to use 'mc' the linux answer to 
midnight-commander.
You will have more oversight as to what you are deleting and will not be faced 
with the same problem we saw here a few days ago when someone asked how he 
could recover his system after he made a mistake with rm -rf.


>
> Thanks,
> Matthew Stapleton

-- 
Regards Richard
pa3gcu@zeelandnet.nl
http://people.zeelandnet.nl/pa3gcu/



-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: recursively removing directories
@ 2002-06-30 10:04 Matthew Stapleton
  2002-06-30 10:16 ` Richard Adams
  0 siblings, 1 reply; 6+ messages in thread
From: Matthew Stapleton @ 2002-06-30 10:04 UTC (permalink / raw)
  To: pa3gcu; +Cc: linux-newbie

The reason I asked is because I expanded a *.tar.gz file to look-at/build
and then decided I needed to erase the directory later....Thanks for the
warning....

Matthew


On Sun, 30 Jun 2002 08:26:37 +0000 Richard Adams <pa3gcu@zeelandnet.nl>
writes:
> On Sunday 30 June 2002 01:44, Matthew Stapleton wrote:
> > How do I recursively remove all the subdirectories and contents of 
> a
> > particular directory in Linux? I know of 'rmdir', but this only 
> works for
> > empty directories.  I need something like DOS's 'deltree'.
> 
> You got 2 other answers to your question, one mentioned the need to 
> be "very 
> carefull" with rm, what they did not say is you can wipe out your 
> complete 
> system with rm and its options.
> I would strongly advise you to use 'mc' the linux answer to 
> midnight-commander.
> You will have more oversight as to what you are deleting and will 
> not be faced 
> with the same problem we saw here a few days ago when someone asked 
> how he 
> could recover his system after he made a mistake with rm -rf.
> 
> 
> >
> > Thanks,
> > Matthew Stapleton
> 
> -- 
> Regards Richard
> pa3gcu@zeelandnet.nl
> http://people.zeelandnet.nl/pa3gcu/
> 
> 
> 
> -
> To unsubscribe from this list: send the line "unsubscribe 
> linux-newbie" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.linux-learn.org/faqs
> 

 
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: recursively removing directories
  2002-06-30 10:04 Matthew Stapleton
@ 2002-06-30 10:16 ` Richard Adams
  0 siblings, 0 replies; 6+ messages in thread
From: Richard Adams @ 2002-06-30 10:16 UTC (permalink / raw)
  To: Matthew Stapleton; +Cc: linux-newbie

On Sunday 30 June 2002 10:04, Matthew Stapleton wrote:
> The reason I asked is because I expanded a *.tar.gz file to look-at/build
> and then decided I needed to erase the directory later....Thanks for the
> warning....

Ok, well you can read a tar.gz file first with 'zless' you can then navigate 
thro' it with the search option which is '/' an example would be;
zless foo.tar.gz
/INSTALL
Now you will see all instances of the word INSTALL, ctrl-l goes to the next 
instance.
man less will explain.

Another hint to remove dirs is go into the directory to be deleted, then use 
rm -rf * and or rm -rf .* then cd .. rmdir <foo>
That way is a safer method but caution is the word.

>
> Matthew
>

-- 
Regards Richard
pa3gcu@zeelandnet.nl
http://people.zeelandnet.nl/pa3gcu/



-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2002-06-30 10:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-06-30  1:44 recursively removing directories Matthew Stapleton
2002-06-30  1:50 ` Joseph Jackson
2002-06-30  6:57   ` cr
2002-06-30  8:26 ` Richard Adams
  -- strict thread matches above, loose matches on Subject: below --
2002-06-30 10:04 Matthew Stapleton
2002-06-30 10:16 ` Richard Adams

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.