Warning: include() [function.include]: URL file-access is disabled in the server configuration in /home/.showoff/linuxfaqs/linux-faqs.com/HOWTO/Bzip2-5.php on line 23

Warning: include(http://www.linux-faqs.com/HOWTO/header.inc) [function.include]: failed to open stream: no suitable wrapper could be found in /home/.showoff/linuxfaqs/linux-faqs.com/HOWTO/Bzip2-5.php on line 23

Warning: include() [function.include]: Failed opening 'http://www.linux-faqs.com/HOWTO/header.inc' for inclusion (include_path='.:/usr/local/php5/lib/php:/usr/local/lib/php') in /home/.showoff/linuxfaqs/linux-faqs.com/HOWTO/Bzip2-5.php on line 23

Warning: include() [function.include]: URL file-access is disabled in the server configuration in /home/.showoff/linuxfaqs/linux-faqs.com/HOWTO/Bzip2-5.php on line 24

Warning: include(http://www.linux-faqs.com/HOWTO/header.bottom.inc) [function.include]: failed to open stream: no suitable wrapper could be found in /home/.showoff/linuxfaqs/linux-faqs.com/HOWTO/Bzip2-5.php on line 24

Warning: include() [function.include]: Failed opening 'http://www.linux-faqs.com/HOWTO/header.bottom.inc' for inclusion (include_path='.:/usr/local/php5/lib/php:/usr/local/lib/php') in /home/.showoff/linuxfaqs/linux-faqs.com/HOWTO/Bzip2-5.php on line 24
 
FAQS
» Advanced Routing & Traffic Control
» General FAQ
» Squid Proxy Server
» Sendmail
» Fetchmail
» Postfix
» Connecting Mobile Phone
» Paging from Linux
» Standard Commands
» Some common terms
Linux HOWTOs
- Single List of HOWTOs
-
Warning: include() [function.include]: URL file-access is disabled in the server configuration in /home/.showoff/linuxfaqs/linux-faqs.com/HOWTO/body.left.inc on line 38

Warning: include(http://www.linux-faqs.com/link1.php) [function.include]: failed to open stream: no suitable wrapper could be found in /home/.showoff/linuxfaqs/linux-faqs.com/HOWTO/body.left.inc on line 38

Warning: include() [function.include]: Failed opening 'http://www.linux-faqs.com/link1.php' for inclusion (include_path='.:/usr/local/php5/lib/php:/usr/local/lib/php') in /home/.showoff/linuxfaqs/linux-faqs.com/HOWTO/body.left.inc on line 38

-
Warning: include() [function.include]: URL file-access is disabled in the server configuration in /home/.showoff/linuxfaqs/linux-faqs.com/HOWTO/body.left.inc on line 39

Warning: include(http://www.linux-faqs.com/link2.php) [function.include]: failed to open stream: no suitable wrapper could be found in /home/.showoff/linuxfaqs/linux-faqs.com/HOWTO/body.left.inc on line 39

Warning: include() [function.include]: Failed opening 'http://www.linux-faqs.com/link2.php' for inclusion (include_path='.:/usr/local/php5/lib/php:/usr/local/lib/php') in /home/.showoff/linuxfaqs/linux-faqs.com/HOWTO/body.left.inc on line 39

-
Warning: include() [function.include]: URL file-access is disabled in the server configuration in /home/.showoff/linuxfaqs/linux-faqs.com/HOWTO/body.left.inc on line 40

Warning: include(http://www.linux-faqs.com/link3.php) [function.include]: failed to open stream: no suitable wrapper could be found in /home/.showoff/linuxfaqs/linux-faqs.com/HOWTO/body.left.inc on line 40

Warning: include() [function.include]: Failed opening 'http://www.linux-faqs.com/link3.php' for inclusion (include_path='.:/usr/local/php5/lib/php:/usr/local/lib/php') in /home/.showoff/linuxfaqs/linux-faqs.com/HOWTO/body.left.inc on line 40

-
Warning: include() [function.include]: URL file-access is disabled in the server configuration in /home/.showoff/linuxfaqs/linux-faqs.com/HOWTO/body.left.inc on line 41

Warning: include(http://www.linux-faqs.com/link4.php) [function.include]: failed to open stream: no suitable wrapper could be found in /home/.showoff/linuxfaqs/linux-faqs.com/HOWTO/body.left.inc on line 41

Warning: include() [function.include]: Failed opening 'http://www.linux-faqs.com/link4.php' for inclusion (include_path='.:/usr/local/php5/lib/php:/usr/local/lib/php') in /home/.showoff/linuxfaqs/linux-faqs.com/HOWTO/body.left.inc on line 41

-
Warning: include() [function.include]: URL file-access is disabled in the server configuration in /home/.showoff/linuxfaqs/linux-faqs.com/HOWTO/body.left.inc on line 42

Warning: include(http://www.linux-faqs.com/link5.php) [function.include]: failed to open stream: no suitable wrapper could be found in /home/.showoff/linuxfaqs/linux-faqs.com/HOWTO/body.left.inc on line 42

Warning: include() [function.include]: Failed opening 'http://www.linux-faqs.com/link5.php' for inclusion (include_path='.:/usr/local/php5/lib/php:/usr/local/lib/php') in /home/.showoff/linuxfaqs/linux-faqs.com/HOWTO/body.left.inc on line 42

-
Warning: include() [function.include]: URL file-access is disabled in the server configuration in /home/.showoff/linuxfaqs/linux-faqs.com/HOWTO/body.left.inc on line 43

Warning: include(http://www.linux-faqs.com/link6.php) [function.include]: failed to open stream: no suitable wrapper could be found in /home/.showoff/linuxfaqs/linux-faqs.com/HOWTO/body.left.inc on line 43

Warning: include() [function.include]: Failed opening 'http://www.linux-faqs.com/link6.php' for inclusion (include_path='.:/usr/local/php5/lib/php:/usr/local/lib/php') in /home/.showoff/linuxfaqs/linux-faqs.com/HOWTO/body.left.inc on line 43


Warning: include() [function.include]: URL file-access is disabled in the server configuration in /home/.showoff/linuxfaqs/linux-faqs.com/HOWTO/body.left.inc on line 44

Warning: include(http://www.linux-faqs.com/links.php) [function.include]: failed to open stream: no suitable wrapper could be found in /home/.showoff/linuxfaqs/linux-faqs.com/HOWTO/body.left.inc on line 44

Warning: include() [function.include]: Failed opening 'http://www.linux-faqs.com/links.php' for inclusion (include_path='.:/usr/local/php5/lib/php:/usr/local/lib/php') in /home/.showoff/linuxfaqs/linux-faqs.com/HOWTO/body.left.inc on line 44
- ADSL Bandwidth Management
- Compile Apache
- Make a Bootdisk
- Linux-Windows9x-Grub
- Linux-Windows
- Linux Crash Recovery
- Optimise Squid
- Block websites in Squid
- Broadcast webcam in linux
- Compile RedHat Linux kernel
- Implement Firewall Security
- Increase Harddrive Performance
- Mount NTFS filesystem
- Patch / rebuild SRPM
- Secure Linux
- Set up a DHCP Server
- Set up an FTP server
- Set up Linux as a Router
- Use Cron
- Samba
Miscellaneous
» All Ports
» Spammers fetch email addresses
» Mounting NTFS in linux
» Linux Gazette
» Linux Man Pages
» Linux Directory
Linux Man Pages
- Section 1
- Section 2
- Section 3
- Section 4
- Section 5
- Section 6
- Section 7
- Section 8
Linux Directory
- General Information
- Linux Hardware
- Software / Applications
- Web Technology
- Software Development
- Linux Distributions
- Linux Publications
- Linux Beginners


  Next Previous Contents

5. Using bzip2 with less

To uncompress bzip2'd files on the fly, i.e. to be able to use "less" on them without first bunzip2'ing them, you can make a lesspipe.sh (man less) like this:

#!/bin/sh
# This is a preprocessor for 'less'.  It is used when this environment
# variable is set:   LESSOPEN="|lesspipe.sh %s"

  case "$1" in
  *.tar) tar tvvf $1 2>/dev/null ;; # View contents of various tar'd files
  *.tgz) tar tzvvf $1 2>/dev/null ;;
# This one work for the unmodified version of tar:
  *.tar.bz2) bzip2 -cd $1 $1 2>/dev/null | tar tvvf - ;;
#This one works with the patched version of tar:
# *.tar.bz2) tyvvf $1 2>/dev/null ;;
  *.tar.gz) tar tzvvf $1 2>/dev/null ;;
  *.tar.Z) tar tzvvf $1 2>/dev/null ;;
  *.tar.z) tar tzvvf $1 2>/dev/null ;;
  *.bz2) bzip2 -dc $1  2>/dev/null ;; # View compressed files correctly
  *.Z) gzip -dc $1  2>/dev/null ;;
  *.z) gzip -dc $1  2>/dev/null ;;
  *.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 ;;
  esac


Next Previous Contents
 
Warning: include() [function.include]: URL file-access is disabled in the server configuration in /home/.showoff/linuxfaqs/linux-faqs.com/HOWTO/Bzip2-5.php on line 84

Warning: include(http://www.linux-faqs.com/HOWTO/body.right.inc) [function.include]: failed to open stream: no suitable wrapper could be found in /home/.showoff/linuxfaqs/linux-faqs.com/HOWTO/Bzip2-5.php on line 84

Warning: include() [function.include]: Failed opening 'http://www.linux-faqs.com/HOWTO/body.right.inc' for inclusion (include_path='.:/usr/local/php5/lib/php:/usr/local/lib/php') in /home/.showoff/linuxfaqs/linux-faqs.com/HOWTO/Bzip2-5.php on line 84


 

Warning: include() [function.include]: URL file-access is disabled in the server configuration in /home/.showoff/linuxfaqs/linux-faqs.com/HOWTO/Bzip2-5.php on line 89

Warning: include(http://www.linux-faqs.com/HOWTO/footer.inc) [function.include]: failed to open stream: no suitable wrapper could be found in /home/.showoff/linuxfaqs/linux-faqs.com/HOWTO/Bzip2-5.php on line 89

Warning: include() [function.include]: Failed opening 'http://www.linux-faqs.com/HOWTO/footer.inc' for inclusion (include_path='.:/usr/local/php5/lib/php:/usr/local/lib/php') in /home/.showoff/linuxfaqs/linux-faqs.com/HOWTO/Bzip2-5.php on line 89