linux 下命令bzmore介绍及案例使用
bzmore是一个用于分页查看bzip2压缩文件内容的命令行工具。它允许用户一次查看一个屏幕的文件内容,适用于处理大文件或压缩文件
基本语法bashbzmore [options] f.bz2f.bz2:要查看的bzip2压缩文件。功能特点分页显示:bzmore将文件内容分页显示,用户可以逐屏查看。支持压缩和未压缩文件:bzmore可以处理.bz2格式的文件,也可以处理未压缩的文本文件。交互式操作:在显示内容时,bzmore会在屏幕底部显示--More--提示,用户可以使用不同的键进行操作,例如: 按空格键显示下一屏。 按回车键显示下一行。 输入q或Q退出查看。命令:
root@meng:~# which bzmore
/usr/bin/bzmore
root@meng:~# bzmore -h
------> -h <------
bzip2, a block-sorting file compressor. Version 1.0.8, 13-Jul-2019.
usage: bzip2 [flags and input files in any order]
-h --help print this message
-d --decompress force decompression
-z --compress force compression
-k --keep keep (don't delete) input files
-f --force overwrite existing output files
-t --test test compressed file integrity
-c --stdout output to standard out
-q --quiet suppress noncritical error messages
-v --verbose be verbose (a 2nd -v gives more)
-L --license display software version & license
-V --version display software version & license
-s --small use less memory (at most 2500k)
-1 .. -9 set block size to 100k .. 900k
--fast alias for -1
--best alias for -9
If invoked as `bzip2', default action is to compress.
as `bunzip2', default action is to decompress.
as `bzcat', default action is to decompress to stdout.
If no file names are given, bzip2 compresses or decompresses
from standard input to standard output. You can combine
short flags, so `-v -4' means the same as -v4 or -4v, &c.
root@meng:~# bzmore
usage: bzmore files...
案例介绍:
root@meng:~# ls
f1.txt.bz2 f2.txt.bz2 meng.txt.bz2 rec00001f1.txt snap
root@meng:~# bzmore f1.txt.bz2
------> f1.txt.bz2 <------
f1
root@meng:~# bzmore f2.txt.bz2
------> f2.txt.bz2 <------
f2
root@meng:~# bzmore meng.txt.bz2
------> meng.txt.bz2 <------
-M --bignum
-N --use-lc-numeric
-n --non-decimal-data
-o[file] --pretty-print[=file]
-O --optimize
-p[file] --profile[=file]
-P --posix
-r --re-interval
-s --no-optimize
-S --sandbox
-t --lint-old
-V --version
root@meng:~# more f1.txt.bz2
BZh91AY&SY?bǐ !aw$S ^L6/