However, the bash shell makes it easy enough to delete everything. For a tar file, this command deletes everything that was extracted from the tarball:
$ rm `tar tfz sometarball.tgz`
Zip files are tougher, since Zip utilities usually don't have a command line interface. But if you have Java installed, you can do the same thing. Java has a jar command that's very similar to tar, but works on Zip archives. (It has a few extensions, but those are irrelevant here.) So here's how you clean up after an exploding zip file:
$ rm `jar tf somezipball.zip`
Syntactically, these two commands are identical. They both list all the files in the archive, then pass the result to the rm (Unix/Linux delete) command. The z option in the tar command tells tar that it's dealing with a compressed file. If the file isn't compressed (normally the case if the file extension is just .tar), omit it. The z option isn't needed with the jar commands; zip files are always compressed.
This refreshed edition serves as the most valuable guide yet to the bash shell. It's full of practical examples of shell commands and programs guaranteed to make everyday use of Linux that much easier. Includes information on key bindings, command line editing and processing, integrated programming features, signal handling, and much more!




Help








