Skip to content
geeksforgeeks
  • Tutorials
    • Python
    • Java
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
    • Practice Coding Problems
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Shell Scripting
  • Kali Linux
  • Ubuntu
  • Red Hat
  • CentOS
  • Docker in Linux
  • Kubernetes in Linux
  • Linux interview question
  • Python
  • R
  • Java
  • C
  • C++
  • JavaScript
  • DSA
Open In App

bzmore command in Linux with examples

Last Updated : 19 Dec, 2022
Comments
Improve
Suggest changes
Like Article
Like
Report

bzmore command in Linux is used as a filter for CRT viewing of bzip2 compressed files, which are saved with .bz2 suffix. In simple words, using 'bzmore', the content of the file can be viewed on the screen without uncompressing the file. bzip2 is a block-sorting file compressor which compresses files using the Burrows-Wheeler block sorting text compression algorithm, and Huffman coding. bzip2 compresses files more effectively than the older Deflate (.zip and .gz) and LZW (.Z) compression algorithms, but is slower. While the bzip2 command line utility can be used to compress files, there are many other tools that let you perform basic tasks - like searching, comparing, and more without the need to uncompress them. bzmore is just like 'more' command in Linux but it is mainly used for compressed bz2 files. bzmore allows examination of compressed files one screenful at a time on the terminal and pauses, with the bottom line printing “–More–” on the screen. For performing further tasks on the terminal, various options are available. Syntax :

bzmore [ name ...]

Example: A text file named GFG.txt is compressed via bzip2. After the compression, the file is saved as GFG.txt.bz2. In this file, for instance contains numbers ranging from 1 to 40 like this:

1 2 3 . . . 40

Now, To view the contents of this file execute the following command:

bzmore filename.bz2

view content of file through bzmore This command prints a screenful of text on the terminal. Options: These options are executed on the '--More--' statement present in the end of the terminal.

  • d : It displays 11 more lines on the terminal. It means a 11 lines scroll is performed. Input:
d
  • Output: option d for bzmore
  • i(space) : It displays i more lines on the terminal. If no i is given, it shows another screenful scroll. Here, i is an integer argument, defaulting to 1. Input:
4(space)
  • Output: option i(space) for bzmore
  • iz : This option displays i more lines same as i(space) and the scroll is now set to i. Input:
5z
  • Output: option iz for bzmore
  • is : It skips i number of lines and prints the lines according to the previously saved i. If no i is given, it then print screenful of lines. Input:
2s
  • Output: option is for bzmore Note: The previously saved i in option3 was 5, so this options skipped 2 lines as commanded and then a 5 line scroll is printed.
  • if : This option skips whole i screenfuls and print a screenful of lines. If i is already saved using previous commands, this command skips i(previous) * i(present) lines and print a screenful of lines. Example 1: In this example, no i is previously saved. Input:.
1f
  • Output: option if with no i saved for bzmore Example 2: In this example, i=2 is saved previously using the command 2z. Input:
2f
  • Output: option if with i saved for bzmore Note: 4 ( 2*2 ) lines are skipped on the terminal and 2 lines are printed because of the previously saved i=2.
  • q : This command lets quit the reading of the current file. Input:
q
  • Output: option q for bzmore
  • = (equals): It shows the current line number on the terminal. Input:
=
  • Output: option =(equals) for bzmore
  • . (dot) : This command repeats the previously entered command. Input:
.
  • Output: option (dot) for bzmore Note: The previously entered command was 2(space), so two lines are printed and then by using .(dot) command previously entered command is repeated.
  • --help: It displays help information. Syntax :
$ bzmore --help
  • Output: option -help for bzmore
  • --version: It displays version information. Syntax:
$ bzmore --version
  • Output: option -version for bzmore

R

raghavmangal22
Improve
Article Tags :
  • Linux-Unix

Similar Reads

    batch command in Linux with Examples
    batch command is used to read commands from standard input or a specified file and execute them when system load levels permit i.e. when the load average drops below 1.5. Syntax: batch It is important to note that batch does not accepts any parameters. Other Similar Commands: atq: Used to display th
    1 min read
    bc command in Linux with examples
    bc command is used for command line calculator. It is similar to basic calculator by using which we can do basic mathematical calculations. Arithmetic operations are the most basic in any kind of programming language. Linux or Unix operating system provides the bc command and expr command for doing
    11 min read
    bg command in Linux with Examples
    In Linux, the bg command is a useful tool that allows you to manage and move processes between the foreground and background. It's especially helpful when you want to multitask in the terminal by placing a process in the background, enabling you to continue using the terminal for other commands whil
    3 min read
    biff command in Linux
    If you're working on a Unix or Linux terminal and want instant alerts for incoming emails then the biff command is just what you need. Originally built for early Unix systems, biff is a lightweight terminal-based mail notification tool that instantly pops up when new mail arrives. It gets its name f
    3 min read
    bind command in Linux with Examples
    bind command is a Bash shell builtin command. It is used to set Readline key bindings and variables. The keybindings are the keyboard actions that are bound to a function. So it can be used to change how the bash will react to keys or combinations of keys, being pressed on the keyboard. Here, we’ll
    4 min read
    bison command in Linux with Examples
    bison command is a replacement for the yacc. It is basically a parser generator similar to yacc. Input files should follow the yacc convention of ending in .y format. Similar to yacc, the generated files do not have fixed names, but instead use the prefix of the input file. Moreover, if you need to
    4 min read
    break command in Linux with examples
    The break command in Linux is primarily used within loops to exit or terminate the loop prematurely based on certain conditions. It offers a quick and convenient way to escape from a loop's execution, whether it's a for loop, a while loop, or a nested loop structure. It can also take one parameter i
    2 min read
    builtin command in Linux with examples
    The builtin command in shell scripting is used to execute a shell builtin, passing it arguments, and also retrieving its exit status. Its primary use is to ensure that you can call the original functionality of a builtin command even when a function with the same name is defined. Syntaxbuiltin [shel
    2 min read
    bzcmp command in Linux with examples
    The bzcmp utility is used to invoke the cmp utility on bzip2 compressed files. All options specified are passed directly to cmp. As internally bzcmp calls cmp, We can pass the cmp command options to bzcmp. If only one file is specified, then the files compared are file1 and an uncompressed file1.bz2
    2 min read
    bzdiff command in linux with examples
    bzdiff command in Linux is used to compare the bzip2 compressed files. Bzcmp and bzdiff are used to invoke the cmp or the diff program on bzip2 compressed files. All options specified are passed directly to cmp or diff. If only one file is specified, then the files compared are file1 and an uncompre
    1 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences