27.08.2015 Views

Advanced Bash−Scripting Guide

Advanced Bash-Scripting Guide - Nicku.org

Advanced Bash-Scripting Guide - Nicku.org

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Advanced</strong> <strong>Bash−Scripting</strong> <strong>Guide</strong><br />

This option will not work on magnetic tape devices.<br />

4. −r append (files to existing archive)<br />

5. −A append (tar files to existing archive)<br />

6. −t list (contents of existing archive)<br />

7. −u update archive<br />

8. −d compare archive with specified filesystem<br />

9. −z gzip the archive<br />

(compress or uncompress, depending on whether combined with the −c or −x) option<br />

10. −j bzip2 the archive<br />

shar<br />

ar<br />

rpm<br />

It may be difficult to recover data from a corrupted gzipped tar archive. When<br />

archiving important files, make multiple backups.<br />

Shell archiving utility. The files in a shell archive are concatenated without compression, and the<br />

resultant archive is essentially a shell script, complete with #!/bin/sh header, and containing all the<br />

necessary unarchiving commands. Shar archives still show up in Internet newsgroups, but otherwise<br />

shar has been pretty well replaced by tar/gzip. The unshar command unpacks shar archives.<br />

Creation and manipulation utility for archives, mainly used for binary object file libraries.<br />

The Red Hat Package Manager, or rpm utility provides a wrapper for source or binary archives. It<br />

includes commands for installing and checking the integrity of packages, among other things.<br />

A simple rpm −i package_name.rpm usually suffices to install a package, though there are many<br />

more options available.<br />

An rpm −qa gives a complete list of all installed rpm packages on a given system.<br />

An rpm −qa package_name lists only the package(s) corresponding to<br />

package_name.<br />

bash$ rpm −qa<br />

redhat−logos−1.1.3−1<br />

glibc−2.2.4−13<br />

cracklib−2.7−12<br />

dosfstools−2.7−1<br />

gdbm−1.8.0−10<br />

ksymoops−2.4.1−1<br />

mktemp−1.5−11<br />

perl−5.6.0−17<br />

reiserfs−utils−3.x.0j−2<br />

...<br />

bash$ rpm −qa docbook−utils<br />

docbook−utils−0.6.9−2<br />

bash$ rpm −qa docbook | grep docbook<br />

docbook−dtd31−sgml−1.0−10<br />

docbook−style−dsssl−1.64−3<br />

docbook−dtd30−sgml−1.0−10<br />

docbook−dtd40−sgml−1.0−11<br />

docbook−utils−pdf−0.6.9−2<br />

Chapter 12. External Filters, Programs and Commands 177

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!