Re: Removing downloaded Oracle software

  • From: Mark Brinsmead <pythianbrinsmead@xxxxxxxxx>
  • To: cemail_219@xxxxxxxxxxx
  • Date: Sun, 17 May 2009 15:11:46 -0600

Sometimes a little bit of paranoia can be very healthy.

The simple answer is "rm -rf", as we have heard a few times already.

If you are paranoid (i.e., "careful") you could consider a two stage
approach similar to this:

#  find  /directory/to/be/deleted -exec ls -ld {} \;
#  find  /directory/to/be/deleted -exec rm -f {} \;

The first command lists EVERY file that is doing to be deleted, allowing you
to inspect the list and make sure there is nothing "bad" there.

The second command removes the files.  (Actually, as written, it will delete
ONLY files, not directories, but this should give the idea.)

My preference is to use a command-line editor to change the first command to
the second, as that way I can be sure that the *only* difference is the 'ls'
command versus the 'rm' command.  The thing most likely to kill you is going
to be a mistype in the directory name, after all.  Consider, for example,
the difference between "rm -rf ./*" and "rm -rf . /*" -- the difference is
only a single keystroke.  And a bare-metal recovery.



On Fri, May 15, 2009 at 8:34 AM, J. Dex <cemail_219@xxxxxxxxxxx> wrote:

>  I am nervous about doing this since it is Linux versus other OS.  What is
> the correct command to use to remove a directory and all of the files that
> fall under that directory without receiving questions back about whether or
> not want to remove various files within the that directory?   In other
> words, using the example below, I want to remove the
> "directory_to_be_removed" including any files that are in it without having
> to respond yes repeatedly?   The directory being removed is actually
> downloaded Oracle software from CD (but not the location where the install
> of the software itself is actually located at).
>
> /u04/db_files/directory_to_be_removed
>
>
>
>
> ------------------------------
> Hotmail® goes with you. Get it on your BlackBerry or 
> iPhone.<http://windowslive.com/Tutorial/Hotmail/Mobile?ocid=TXT_TAGLM_WL_HM_Tutorial_Mobile1_052009>
>



-- 
Cheers,
-- Mark Brinsmead
  Senior DBA,
  The Pythian Group
  http://www.pythian.com/blogs

Other related posts: