1 / 8

Archive Utilities

Archive Utilities. Learning Objectives: To introduce different archive utilities for file compression with their usage To compare & summarized different archive utilities. Archive Utilities. Table of Content Compress gzip compression Zip compression (PC Compatible)

kemal
Télécharger la présentation

Archive Utilities

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Archive Utilities Learning Objectives: To introduce different archive utilities for file compression with their usage To compare & summarized different archive utilities

  2. Archive Utilities Table of Content • Compress • gzip compression • Zip compression (PC Compatible) • Zip (PC pkzip Compatible) • Unzip (PC pkunzip Compatible) • tar archive • No compression • Selective restore • With Compression • Cpio ( selected reference ) • Summary

  3. Summary (*) Not available in all systems, may need to download, see www.gnu.org

  4. Compress / Uncompress • Compression single file and available on most systems • Compressed .z file smaller, file date preserved • Actually compression ratio depend on data (text file and database files usually larger) $ ls -l buyer* 22651778 Nov 16 18:45 buyer.dbf $ compress buyer.dbf $ ls -l buyer* 3603257 Nov 16 18:45 buyer.dbf.Z $ uncompress buyer.dbf.Z $ ls -l buyer* 22651778 Nov 16 18:45 buyer.dbf

  5. gzip Compression • Backward compatible with compress, better compression ratio • Available from GNU www.gnu.org • gunzip – un-compresses $ gzip –h gzip 0.7 (5 Jan 93) usage: gzip [-cdfhLrtvV19] [file ...] -c --stdout write on standard output, keep original files unchanged -d --decompress decompress -f --force force overwrite of output file and compress links -h --help give this help -L --license display software license -r --recurse recurse through directories -t --test test compressed file integrity -v --verbose verbose mode -V --version display version number -1 --fast compress faster -9 --best compress better file... files to (de)compress. If none given, use standard input.

  6. tar archive $ tar cvf /tmp/tar2.tar * a letter0 1K a secret/ 0K a secret/letter1 1K a secret/letter2 1K • Traditional archive utility – backup directory tree(s) $ tar cvf /tmp/tar1.tar . a ./ 0K a ./letter0 1K a ./secret/ 0K a ./secret/letter1 1K a ./secret/letter2 1K $ tar xvf /tmp/tar1.tar Restores the directory tree

  7. Disks Usage Statistics • df display free blocks and # of files in each file system $ df | head /proc (/proc ): 0 blocks 934 files / (/dev/dsk/c0t3d0s0 ): 226544 blocks 280996 files /dev/fd fd ): 0 blocks 0 files /var (/dev/dsk/c0t3d0s3 ): 1480320 blocks 252851 files /cache (/dev/dsk/c0t3d0s4 ): 308472 blocks 243243 files /home (/dev/dsk/c0t3d0s7 ): 1408858 blocks 284098 files /tmp (swap ): 2903968 blocks 10169 files /var/mail(mail:/mail ):14054672 blocks 1097254 files /var/spool/uucp (mail:/var/spool/uucp): 3450734 blocks 350809 files • du display disk usage statistics (in number of 512k blocks) $ du | head -5 282 ./zmodem 14 ./gzip-0.7/msdos 2 ./gzip-0.7/os2 662 ./gzip-0.7 3626 ./mail du shows disk usage of directories in 512k blocks

  8. User Groups (2) • View users of a group $ ypcat group | grep comp111 comp111:*:40000:kwchiu,john usage: groupmod [-g gid [-o]] [-n name] group • Renaming a group (super-user only) $ groupmod usage: groupmod [-g gid [-o]] [-n name] group $ groupmod -n cs111 comp111 • Deleting a group $ groupdel usage: groupdel group $ groupdel cs111

More Related