bzmore

file viewinglinux
The bzmore command is one of the most frequently used commands in Linux/Unix-like operating systems. bzmore View bzip2 compressed files using the more pager

Quick Reference

Command Name:

bzmore

Category:

file viewing

Platform:

linux

Basic Usage:

bzmore [options] [arguments]

Common Use Cases

  • 1

    Compressed file viewing

    View bzip2 compressed files page by page

  • 2

    Data inspection

    Inspect compressed data with pagination

  • 3

    Content browsing

    Browse compressed file contents

  • 4

    Log analysis

    Analyze compressed log files

Syntax

bzmore [file.bz2 ...]

Options

Option Description
-d Display "Press space to continue, 'q' to quit" prompt
-f Count logical lines instead of screen lines
-l Ignore form feed (^L) characters
-c Display pages by clearing instead of scrolling
-p Do not scroll, clean screen and display text
-s Squeeze multiple blank lines into one
-u Suppress underlining

Note: bzmore supports options that the more command accepts, as it is a wrapper around bunzip2 and more.

Examples

How to Use These Examples

The examples below show common ways to use the bzmore command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.

Basic Examples:

View a compressed file with paging
bzmore file.txt.bz2
Search within a file by pressing '/'
bzmore large_log.bz2
# Then type your search pattern
View multiple compressed files
bzmore file1.bz2 file2.bz2 file3.bz2
# Press :n to move to the next file

Advanced Examples:

Pipe output to another command
bzmore file.bz2 | grep "error"
View multiple files from find command
find /var/log/ -name "*.log.bz2" -exec bzmore {} \;
Examine a compressed log file
bzmore /var/log/syslog.1.bz2
Save decompressed output to a file
bzmore file.bz2 > decompressed_file.txt
Filter with grep then page through results
bzcat file.bz2 | grep "search term" | more

Try It Yourself

Practice makes perfect! The best way to learn is by trying these examples on your own system with real files.

Understanding Syntax

Pay attention to the syntax coloring: commands, options, and file paths are highlighted differently.

Notes

Key Features:

The bzmore command allows viewing bzip2-compressed files with these benefits:

  • View compressed files without explicitly decompressing them first
  • Page through compressed files one screen at a time
  • Search within compressed files using the more pager functionality
  • View multiple compressed files in sequence
  • Saves disk space by not requiring explicit decompression

Common More Navigation Commands:

  • Space: Display the next page
  • Enter: Display the next line
  • b: Go back one page (may not work in all implementations)
  • /pattern: Search for 'pattern'
  • n: Repeat the previous search
  • =: Show the current line number
  • :f: Show the current file name and line number
  • :n: Go to the next file (when multiple files specified)
  • q or Q: Quit

Implementation Details:

bzmore is a shell script that works as a wrapper by:

  • Using bunzip2 to decompress the input file
  • Piping the output to the more pager for display
  • Handling navigation between multiple files

Usage Tips:

  • Use bzmore for quick viewing of compressed text files
  • For more advanced features like backward scrolling, consider using bzless instead
  • The more pager is simpler than less but may have fewer features depending on your system
  • For very large files, bzmore uses less memory than decompressing the entire file first
  • Press 'h' while viewing to display help in some implementations

Limitations:

  • Fewer features compared to bzless (which uses the more powerful less pager)
  • Limited backward scrolling capabilities
  • Not suitable for viewing binary or non-text content
  • Requires the bzip2 package to be installed
  • Performance may be slower with very large compressed files

Common Use Cases

Compressed file viewing

View bzip2 compressed files page by page

Data inspection

Inspect compressed data with pagination

Content browsing

Browse compressed file contents

Log analysis

Analyze compressed log files

Document viewing

View compressed documents

Related Commands

These commands are frequently used alongside bzmore or serve similar purposes:

Use Cases

1

Compressed file viewing

View bzip2 compressed files page by page

2

Data inspection

Inspect compressed data with pagination

3

Content browsing

Browse compressed file contents

4

Log analysis

Analyze compressed log files

5

Document viewing

View compressed documents

Learn By Doing

The best way to learn Linux commands is by practicing. Try out these examples in your terminal to build muscle memory and understand how the bzmore command works in different scenarios.

$ bzmore
View All Commands