next up previous contents
Next: A Forklift Can Up: Moving Information Previous: cp Like a

Pruning Back with rm

 

Now that we've learned how to create millions of files with cp  (and believe me, you'll find new ways to create more files soon), it may be useful to learn how to delete them. Actually, it's very simple: the command you're looking for is rm, and it works just like you'd expect.

Any file that's a parameter to rm gets deleted:

rm file1 file2 ... fileN

For example:

As you can see, rm is extremely unfriendly. Not only does it not ask you for confirmation, but it will also delete things even if the whole command line wasn't correct. This could actually be dangerous. Consider the difference between these two commands:

and this

As you can see, the difference of one character made a world of difference in the outcome of the command. It is vital that you check your command lines before hitting [Enter]!

 



Ross Biro
Thu May 25 10:45:54 PDT 1995