Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Decompressing a .lzo file using shell script [closed]

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.

Thanks in advance.

like image 612
Vikas Avatar asked Jun 06 '13 13:06

Vikas


2 Answers

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

$ 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!

like image 174
l0b0 Avatar answered Oct 09 '22 10:10

l0b0


Have you tried using lzop with -d command?

lzop -d file.lzo

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

Regards.

like image 20
wizard Avatar answered Oct 09 '22 08:10

wizard