geekvenue.net

Welcome to Chucktips Hardware HELP WITH DEAD OS Installing FreeBSD Miscellaneous
 faq
 search
 add article
 cool-stuff
 how-to
 main
 tips


TIP: Delete Files with Caution
Miscellaneous Posted by Jason on Tuesday April 03, @06:39PM
from the What-Have-I-Done dept.
If you would like to delete a directory and all of it's sub-directories and files, use the rm command with the -rf flags.

But be careful!
The rm -rf command sequence is a deadly cocktail. Always explicitly change to the directory you want to delete, or you my accidentally hit the Enter key half way through typing the full path. If that happens, your files and directories will disappear quicker than you can say - oops!

The -rf flags represent:
   -r is for recursive (delete all files and directories)
   -f is for force (do not prompt me, just delete them)

Example:
If you are feeling guilty about downloading all those Metallica mp3s - and I know you are =;-), you can delete them instantly.

Assuming that all your metallica mp3 files are in the sub-directory metallica of your mp3s directory:

   Login: jason
   Password: **********

   $ cd /usr/home/jason/mp3s
   $ rm -rf metallica

If you would like to learn more about the rm command and its flags try the man pages.

man rm

<  |  >

 

Related Links
  • Articles on Miscellaneous
  • Also by Jason
  • Contact author

    Lilliput Mini USB Computer Monitor

    If you have ever wanted to learn about Cisco Routers, check out my new book "Cisco Routers for the Small Business" - it's Cisco CLI for the Regular Guy!

  • Sponsors

    The Fine Print: The following comments are owned by whoever posted them.
    ( Add a Reply )

    "You never know how many friends you have until you own a Condo on the beach." -- Jason's Postulate

    Powered by Zope  Powered by Apache  Squishdot Powered
    All trademarks and copyrights on this page are owned by their respective companies. Comments are owned by the Poster. The Rest ©2001 Jason Neumann.
    [ main | post article | search ]