Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "Archive Utilities Learning Objectives: 1. To introduce different archive utilities for file compression with their usage 2. To compare & summarized different."— Presentation transcript:

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

2 COMP111 Lecture a1 / Slide 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 COMP111 Lecture a1 / Slide 3 Summary ArchiveRestoreListUsage Notes compressuncompressCompress single file (*) gzipgzip -dgzip -lBackward compatible with compress Compress (better ratio) single file (*) zip (-r)unzipunzip -vDOS pkzip / Winzip compatible Compress/backup multiple files/ dir. tar cvftar xvftar cvfBackup multiple files/ dir. (cf. gtar (*)) cpio -ocvBcpio -icvdBcpio -icvtBBackup Multiple files/ dir. (with owners / group) For your reference only (*) Not available in all systems, may need to download, see www.gnu.org

4 COMP111 Lecture a1 / Slide 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 COMP111 Lecture a1 / Slide 5 gzip Compression  Backward compatible with compress, better compression ratio  Available from GNU www.gnu.orgwww.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 COMP111 Lecture a1 / Slide 6 tar archive  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 $ tar cvf /tmp/tar2.tar * a letter0 1K a secret/ 0K a secret/letter1 1K a secret/letter2 1K

7 COMP111 Lecture a1 / Slide 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 COMP111 Lecture a1 / Slide 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


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

Similar presentations


Ads by Google