⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bzip2.txt

📁 linux-bible.rar linux-bible.rar
💻 TXT
📖 第 1 页 / 共 2 页
字号:
  *.gz) gzip -dc $1  2>/dev/null ;;  *.zip) unzip -l $1 2>/dev/null ;;  *.1|*.2|*.3|*.4|*.5|*.6|*.7|*.8|*.9|*.n|*.man) FILE=`file -L $1` ; # groff src    FILE=`echo $FILE | cut -d ' ' -f 2`    if [ "$FILE" = "troff" ]; then      groff -s -p -t -e -Tascii -mandoc $1    fi ;;  *) cat $1 2>/dev/null ;;#  *) FILE=`file -L $1` ; # Check to see if binary, if so -- view with 'strings'#    FILE1=`echo $FILE | cut -d ' ' -f 2`#    FILE2=`echo $FILE | cut -d ' ' -f 3`#    if [ "$FILE1" = "Linux/i386" -o "$FILE2" = "Linux/i386" \#         -o "$FILE1" = "ELF" -o "$FILE2" = "ELF" ]; then#      strings $1#    fi ;;  esac6. 使用 bzip2 来结合 emacs6.1 为每个人改变 emacs:   我写了下面的给 jka-compr.el 用的修补,它会加入 bzip2 成为自动压缩模式。      除外条款: 我只在 emacs-20.2上试过这个,但是我也找不到有 啥麽理由来相信   同样的方法却不能在其他版本上使用的。      使用它,    1. 到 emacs-20.2/lisp 原始程式码目录□ (看你在哪儿 untarred 它的)    2. 把下面的修补做成叫 jka-compr.el.diff 的档案(全放在这档案□ )。    3. 然後执行        patch < jka-compr.el.diff    4. 启动 emacs,再执行        M-x byte-compile-file jka-compr.el    5. 离开 emacs。    6. 把它原来的 jka-compr.elc 放到安全的地方以防有臭虫时备用。    7. 用新的 jka-compr.elc来代替它。    8. 好好玩吧!       --- jka-compr.el        Sat Jul 26 17:02:39 1997+++ jka-compr.el.new    Thu Feb  5 17:44:35 1998@@ -44,7 +44,7 @@ ;; The variable, jka-compr-compression-info-list can be used to ;; customize jka-compr to work with other compression programs. ;; The default value of this variable allows jka-compr to work with-;; Unix compress and gzip.+;; Unix compress and gzip.  David Fetter added bzip2 support :) ;; ;; If you are concerned about the stderr output of gzip and other ;; compression/decompression programs showing up in your buffers, you@@ -121,7 +121,9 @@ ;;; I have this defined so that .Z files are assumed to be in unix-;;; compress format; and .gz files, in gzip format.+;;; compress format; and .gz files, in gzip format, and .bz2 files,+;;; in the snappy new bzip2 format from http://www.muraroa.demon.co.uk.+;;; Keep up the good work, people! (defcustom jka-compr-compression-info-list   ;;[regexp   ;; compr-message  compr-prog  compr-args@@ -131,6 +133,10 @@      "compressing"    "compress"     ("-c")      "uncompressing"  "uncompress"   ("-c")      nil t]+    ["\\.bz2\\'"+     "bzip2ing"        "bzip2"         ("")+     "bunzip2ing"      "bzip2"         ("-d")+     nil t]     ["\\.tgz\\'"      "zipping"        "gzip"         ("-c" "-q")      "unzipping"      "gzip"         ("-c" "-q" "-d")6.2 为某人改变 emacs:   这次要谢谢 Ulrik Dickow, [31]ukd@kampsax.dk,他是Kampsax Technology的系   统程式设计师 :      为了让非 sysadmin 的朋友可以自动地使用 bzip2,只需在你的 .emacs 档案□   加上下列东东。   ;; Automatic (un)compression on loading/saving files (gzip(1) and similar);; We start it in the off state, so that bzip2(1) support can be added.;; Code thrown together by Ulrik Dickow for ~/.emacs with Emacs 19.34.;; Should work with many older and newer Emacsen too.  No warranty though.;;(if (fboundp 'auto-compression-mode) ; Emacs 19.30+    (auto-compression-mode 0)  (require 'jka-compr)  (toggle-auto-compression 0));; Now add bzip2 support and turn auto compression back on.(add-to-list 'jka-compr-compression-info-list             ["\\.bz2\\(~\\|\\.~[0-9]+~\\)?\\'"              "zipping"        "bzip2"         ()              "unzipping"      "bzip2"         ("-d")              nil t])(toggle-auto-compression 1 t)7. 用 bzip2 来配合 wu-ftpd   感谢 Arnaud Launay 这则节省频宽的秘诀。下面的内容应该是放到   /etc/ftpconversions □面来达成以 bzip2 来做即时压缩及解压缩 。请确认路   径 (像 /bin/compress) 要正确。    :.Z:  :  :/bin/compress -d -c %s:T_REG|T_ASCII:O_UNCOMPRESS:UNCOMPRESS :   : :.Z:/bin/compress -c %s:T_REG:O_COMPRESS:COMPRESS :.gz: :  :/bin/gzip -cd %s:T_REG|T_ASCII:O_UNCOMPRESS:GUNZIP :   : :.gz:/bin/gzip -9 -c %s:T_REG:O_COMPRESS:GZIP :.bz2: :  :/bin/bzip2 -cd %s:T_REG|T_ASCII:O_UNCOMPRESS:BUNZIP2 :   : :.bz2:/bin/bzip2 -9 -c %s:T_REG:O_COMPRESS:BZIP2 :   : :.tar:/bin/tar -c -f - %s:T_REG|T_DIR:O_TAR:TAR :   : :.tar.Z:/bin/tar -c -Z -f - %s:T_REG|T_DIR:O_COMPRESS|O_TAR:TAR+COMPRESS :   : :.tar.gz:/bin/tar -c -z -f - %s:T_REG|T_DIR:O_COMPRESS|O_TAR:TAR+GZIP :   : :.tar.bz2:/bin/tar -c -y -f - %s:T_REG|T_DIR:O_COMPRESS|O_TAR:TAR+BZIP28. 使用 bzip2 来配合 grep   下面的公用程式,我管它叫 bgrep,事实上是把伴随在 Linux 的 zgrep 做个小   更改 而已。你可以使用它来 grep,而不需先 bunzip2 档案。   #!/bin/sh# bgrep -- a wrapper around a grep program that decompresses files as neededPATH="/usr/bin:$PATH"; export PATHprog=`echo $0 | sed 's|.*/||'`case "$prog" in        *egrep) grep=${EGREP-egrep}     ;;        *fgrep) grep=${FGREP-fgrep}     ;;        *)      grep=${GREP-grep}       ;;esacpat=""while test $# -ne 0; do  case "$1" in  -e | -f) opt="$opt $1"; shift; pat="$1"           if test "$grep" = grep; then  # grep is buggy with -e on SVR4             grep=egrep           fi;;  -*)      opt="$opt $1";;   *)      if test -z "$pat"; then             pat="$1"           else             break;           fi;;  esac  shiftdoneif test -z "$pat"; then  echo "grep through bzip2 files"  echo "usage: $prog [grep_options] pattern [files]"  exit 1filist=0silent=0op=`echo "$opt" | sed -e 's/ //g' -e 's/-//g'`case "$op" in  *l*) list=1esaccase "$op" in  *h*) silent=1esacif test $# -eq 0; then  bzip2 -cd | $grep $opt "$pat"  exit $?fires=0for i do  if test $list -eq 1; then    bzip2 -cdfq "$i" | $grep $opt "$pat" > /dev/null && echo $i    r=$?  elif test $# -eq 1 -o $silent -eq 1; then    bzip2 -cd "$i" | $grep $opt "$pat"    r=$?  else    bzip2 -cd "$i" | $grep $opt "$pat" | sed "s|^|${i}:|"    r=$?  fi  test "$r" -ne 0 && res="$r"doneexit $res9. bzip2 配合 X 下的 Netscape 来使用。   tenthumbs@cybernex.net 说:        我找到一个可以让 Linux Netscape 来使用 bzip2 做为 Content-Encoding     就如同它使用 gzip 一样。把下面的东东加到 $HOME/.Xdefaults 或是     $HOME/.Xresources          我使用 -s 选项,是因为选择放弃解压缩的速度来换得 RAM 的占用。 你可以     把它设成你自己要的。     Netscape*encodingFilters:      \        x-compress :  : .Z     : uncompress -c  \n\        compress   :  : .Z     : uncompress -c  \n\        x-gzip     :  : .z,.gz : gzip -cdq      \n\        gzip       :  : .z,.gz : gzip -cdq      \n\        x-bzip2    :  : .bz2   : bzip2 -ds \n10. 使用 bzip2 来再压缩其他的压缩格式   下面的 perl 程式会把以下列的压缩格式档 (.tar.gz, .tgz. .tar.Z, 和 .Z   for this iteration) 重新打包成最佳的压缩值。这 perl 原始程式都有全方位   的好文件 来说明它做什麽以及它如何办到的。#!/usr/bin/perl -w########################################################                                                     ## This program takes compressed and gzipped programs  ## in the current directory and turns them into bzip2  ## format.  It handles the .tgz extension in a         ## reasonable way, producing a .tar.bz2 file.          ##                                                     ########################################################$counter = 0;$saved_bytes = 0;$totals_file = '/tmp/machine_bzip2_total';$machine_bzip2_total = 0;while(<*[Zz]>) {    next if /^bzip2-0.1pl2.tar.gz$/;    push @files, $_;}$total = scalar(@files);foreach (@files) {    if (/tgz$/) {        ($new=$_) =~ s/tgz$/tar.bz2/;    } else {        ($new=$_) =~ s/\.g?z$/.bz2/i;    }    $orig_size = (stat $_)[7];    ++$counter;    print "Repacking $_ ($counter/$total)...\n";    if ((system "gzip -cd $_ |bzip2 >$new") == 0) {        $new_size = (stat $new)[7];        $factor = int(100*$new_size/$orig_size+.5);        $saved_bytes += $orig_size-$new_size;        print "$new is about $factor% of the size of $_. :",($factor<100)?')':'(',"\n";        unlink $_;    } else {        print "Arrgghh!  Something happened to $_: $!\n";    }}print "You've ",      ($saved_bytes>=0)?"saved":"lost",      " $saved_bytes bytes of storage space :",       ($saved_bytes>=0)?")":"(", "\n";unless (-e '/tmp/machine_bzip2_total') {    system ('echo "0" >/tmp/machine_bzip2_total');    system ('chmod', '0666', '/tmp/machine_bzip2_total');}chomp($machine_bzip2_total = `cat $totals_file`);open TOTAL, ">$totals_file"     or die "Can't open system-wide total: $!";$machine_bzip2_total += $saved_bytes;print TOTAL $machine_bzip2_total;close TOTAL;print "That's a machine-wide total of ",`cat $totals_file`," bytes saved.\n";11. 中译本   译者注: 若您发现本文件内容有翻译不顺畅或错误的地方,请您来信告诉我,以   做更正,谢谢。 译者电子邮件 [32]linuxer.bbs@cis.nctu.edu.tw 或   [33]linux4tw@geocities.com      译注:这份 HOWTO 文件的中文版可在台湾 Linux 使用者组织下的中文 Linux 文   件计画 [34]http://www.linux.org.tw/CLDP/   或是"Linux for Taiwan 台湾人的 Linux "   [35]http://members.xoom.com/linux4tw/ 下取得。References   1. mailto:dfetter@best.com   2. mailto:linuxer.bbs@cis.nctu.edu.tw   3. mailto:linux4tw@geocities.com   4. http://members.xoom.com/linux4tw/   5. file://localhost/tmp/bg5sgmltools.15536/Bzip2-HOWTO.sgml   6. http://www.best.com/~dfetter/Bzip2-HOWTO/Bzip2-HOWTO.sgml   7. mailto:Julian_Seward@muraroa.demon.co.uk   8. file://localhost/tmp/bg5sgmltools.15536/Bzip2.txt.html#bzip2-binaries   9. file://localhost/tmp/bg5sgmltools.15536/Bzip2.txt.html#bzip2-with-tar  10. http://www.muraroa.demon.co.uk/  11. http://www.digistar.com/bzip2/index.html  12. ftp://ftp.redhat.com/pub/contrib  13. http://www.freenix.fr/linux/HOWTO/mini/Bzip2.html  14. ftp://ftp.lip6.fr/pub/linux/french/docs/HOWTO/mini/Bzip2.gz  15. mailto:zoro@mygale.org  16. http://jf.gee.kyoto-u.ac.jp/JF/JF.html  17. http://www2s.biglobe.ne.jp/~kaien/  18. mailto:isaji@mxu.meshnet.or.jp  19. http://user.tninet.se/~uxm165t/linux_doc.html  20. mailto:uxm165t@tninet.se  21. ftp://ftp.debian.org/debian/dists/stable/main/binary-i386/utils/bzip2_0.1pl2-5.deb  22. ftp://ftp.redhat.com/pub/redhat/redhat-5.1/alpha/RedHat/RPMS/bzip2-0.1pl2-1.alpha.rpm  23. ftp://ftp.redhat.com/pub/redhat/redhat-5.1/i386/RedHat/RPMS/bzip2-0.1pl2-1.i386.rpm  24. ftp://ftp.redhat.com/pub/redhat/redhat-5.1/sparc/RedHat/RPMS/bzip2-0.1pl2-1.sparc.rpm  25. ftp://www.cdrom.com/pub/linux/slackware-3.5/slakware/a1/bzip2.tgz  26. ftp://ftp.suse.com/pub/SuSE-Linux/5.2/suse/ap1/bzip.rpm  27. file://localhost/tmp/bg5sgmltools.15536/Bzip2.txt.html#get-bzip2  28. ftp://ftp.redhat.com/pub/contrib/SRPMS/bzip2-0.1pl2-1.src.rpm  29. mailto:leonard@sct1.is.belgacom.be  30. mailto:rubini@morgana.systemy.it  31. mailto:ukdATkampsax.dk  32. mailto:linuxer.bbs@cis.nctu.edu.tw  33. mailto:linux4tw@geocities.com  34. http://www.linux.org.tw/CLDP/  35. http://members.xoom.com/linux4tw/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -