Using bzmore Command In Linux- Examples

bzmore command in Linux (works a bit identical to bzless) is basically used as a filter allowing users to examine compressed or plain text files on full screen at a time. This command can work with both type of files, either the bzip2 compressed files or uncompressed ones. In case if a specified file is non-existing, the bzmore will look for other file with same name, also with a name having suffix .bz2.

While using bzmore, it pauses showing content once the screen is full, and shows –More– at the bottom allow users to switch to next screen to view more by pressing Space. In case if a carriage return is pressed, one more line is displayed.

Technically, the files associated with bzmore is located within /etc/termcap, which includes characteristics of the command, and is also used to determine the window size. Means, if a terminal is capable showing 24 lines, the default window size will be 22 lines.

Syntax to use bzmore command

bzmore [ name.. ]

Options available to use with bzmore command (These options are used when –More– statement is displayed on screen)

  • i<space>: Used for showing i (number) more lines on screen, however if no arguments are specified, displays next screen.
  • ^D: Is used for displaying 11 more lines, in case if i is specified, the scroll size is set to specified number.
  • d: Works similar to ^D
  • iz: Works similar to Space except that i. If i is specified, this specified number becomes the new window size, however the window size will revert back to default once the current file ends.
  • is: Used for skipping i lines and prints next screenful of lines.
  • if: Used for skipping a certain number of screen, and shows the next screenful content.
  • q | Q: Quits reading the current file and looks for other, if specified.
  • e | q: Used for quiting bzmore when –More—statement is printed.
  • s: Used for skipping the next file and continue when –More– statement is printed.
  • =: Displays the current line number.
  • i/expr: Looks for the ith occurrence of the regular expression expr. If the specified pattern is not found, bzmore will look into other file if specified, otherwise shows screenful starting with two lines before where the expr is found.
  • in: Looks for the ith occurrence of the last regular expression entered.
  • !command: Used for invoking a shell with command, where the ! Is replaced with previous shell command.
  • q | Q: Quits reading the current file and looks for the next if specified.
  • .(dot): Pressing a “.” will repeat the previous command.
  • -help: Displays help information and exits.
  • -version: Used for viewing version details.

Examples of bzmore command in Linux

1: Viewing contents of a file in servonode.bz2

bzmore servonode.bz2

2: Displaying version details

bzmore -version

bzmore command example

3: Displaying help information on screen

bzmore -help

bzmore command in Linux