Stop Yourself from Deleting Key Files


rm -i

The -i option (or --interactive) provides a kind of safety net. It asks you before deleting every file. This is a good thing to use while you're running as root!

$ pwd /home/scott/libby/by_pool/lieberman_pool $ ls pool_01.jpg      pool_03.jpg pool_01.jpg_bak  pool_03.jpg_bak $ rm -i *_bak rm: remove regular file 'pool_01.jpg_bak'?  y rm: remove regular file 'pool_03.jpg_bak'?  y $ ls pool_01.jpg   pool_03.jpg 


When rm asks you what to do, a y is an agreement to nuke the file, and an n is an order to spare the file and continue onward to the next file.



Linux Phrasebook
Linux Phrasebook
ISBN: 0672328380
EAN: 2147483647
Year: 2007
Pages: 288

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net