Remove Several Files At Once with Wildcards


rm *

Wildcards such as * help to delete several files with one keystroke.

$ pwd /home/scott/libby/by_pool/lieberman_pool $ ls pool_01.jpg      pool_03.jpg pool_01.jpg_bak  pool_03.jpg_bak $ rm *_bak $ ls pool_01.jpg pool_03.jpg 


Caution

Be very, very, very careful when removing files using wildcards, or you may delete far more than you intended! A classic example is typing rm *txt instead of typing rm * txt (see the errant space?). Instead of deleting all text files, the star means that all files were deleted, and then rm tries to delete a file named txt. Oops!




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