bash 使用 shell 脚本解压 .lzo 文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/16963672/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 23:48:36  来源:igfitidea点击:

Decompressing a .lzo file using shell script

bashshellunixcompressionlzo

提问by Vikas

Ok so i did a fair bit of search on the web and did not find any answers. I am writing a shell script wherein I need to decompress a .lzo file. Do not see any leads. Anyone has any idea? I am basically reading a timestamped log file. My scripts accepts the year, month, date as arguments. I am able to locate my file but now when I have to decompress it, I have no clue how to handle a .lzo file. Help needed.

好的,所以我在网上进行了大量搜索,但没有找到任何答案。我正在编写一个 shell 脚本,其中我需要解压缩一个 .lzo 文件。看不到任何线索。任何人有任何想法?我基本上是在阅读一个带时间戳的日志文件。我的脚本接受年、月、日作为参数。我能够找到我的文件,但是现在当我必须解压缩它时,我不知道如何处理 .lzo 文件。需要帮助。

Thanks in advance.

提前致谢。

回答by l0b0

Literally what I did to figure this out:

从字面上看,我做了什么来解决这个问题:

$ apropos lzo
IO::Uncompress::AnyUncompress (3perl) - Uncompress gzip, zip, bzip2 or lzop file/buffer

Alright, so it's probably got something to do with lzop

好吧,所以它可能与 lzop

$ lzo
No command 'lzo' found, did you mean:
 Command 'lz' from package 'mtools' (main)
 Command 'lzop' from package 'lzop' (universe)
lzo: command not found

The last one looks like it.

最后一张好像。

$ sudo apt-get install lzop
$ lzop 
[...]
Commands:
  -1     compress faster                   -9    compress better
  -d     decompress                        -x    extract (same as -dPp)

Aaand chocolate for everyone!

Aaand巧克力给大家!

回答by wizard

Have you tried using lzopwith -dcommand?

您是否尝试过使用lzopwith-d命令?

lzop -d file.lzo

ref: http://www.lzop.org/lzop_man.php

参考:http: //www.lzop.org/lzop_man.php

Regards.

问候。