-2

My team is working with .GZ files and they need some way, ANY WAY, to extract a .GZ from command line. It can be using Java commands (as long as it can be run from CMD). If it can be done with a third party PORTABLE executable that is fine as well, as long as it's free. I don't have much to go on here so I'm giving the most information as I can. Basically in a nutshell:

  • I need to open .gz files
  • It has to be done through a Batch file (CMD)
  • It cannot use anything that must be installed apart from Java.
  • It can use a portable EXE (toggleable from CMD)

Thanks a bunch, sorry it is low on information! -Lucas E. Executive Programmer for EDG

Side note: This goes along with minecraft, so, I know I can somehow make and extract them since minecraft saves it's log files in .gz format. If the item I need comes with minecraft I can work with that.

8
  • What have you guys tried? Why does this have anything to do with Minecraft?
    – LeoColman
    Jan 27, 2017 at 20:38
  • 2
    This is still not a site to request code for free! Please do your own research, share your efforts and precisely describe what you have problems with! Read the tour and learn How to Ask here!
    – aschipfl
    Jan 27, 2017 at 20:56
  • Asking for what to use to do one particular thing from a batch file is pretty much a question on batch file programming
    – infixed
    Jan 27, 2017 at 21:19
  • Cant figure out much, don't know where to go
    – EDG
    Jan 27, 2017 at 22:09
  • I did my research aschip, so did they. Dude, I'm not going to go on here for free code. I came up with nothing that did not require an install. I did not know the 7zip was portable.
    – EDG
    Jan 27, 2017 at 22:10

2 Answers 2

5

The 7Zip utility can uncompress a gzip file

7z.exe x file.gz -so > uncompressed.dat

7z.exe is portable if you bring its DLLs along (just 7z.dll I think)

It's free in that you personally can use it without payment. It you want to distribute it with a commercial product you may have to contact the owners.

I have seen it mentioned by name when included in a 3rd party product. "Powered by 7zip" But the license on the site reads (in part)

7-Zip
  ~~~~~
  License for use and distribution
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  7-Zip Copyright (C) 1999-2016 Igor Pavlov.

  Licenses for files are:

    1) 7z.dll: GNU LGPL + unRAR restriction
    2) All other files:  GNU LGPL

  The GNU LGPL + unRAR restriction means that you must follow both 
  GNU LGPL rules and unRAR restriction rules.


  Note: 
    You can use 7-Zip on any computer, including a computer in a commercial 
    organization. You don't need to register or pay for 7-Zip.

http://7-zip.org/

1
  • That worked perfectly thank you.
    – EDG
    Jan 27, 2017 at 22:17
1

Java has built-in code for handling gzip streams but it's not accessible from the command line (e.g. you cannot type java -blah and ungz something). If you have access to the Java compiler you can write a small program to ungz your file.

Another option would be to download GNU gzip for Windows (if using Windows) and use the binaries in that package. Any non-windows OS should already have "gunzip" installed, so you wouldn't have to provide anything extra.

Not the answer you're looking for? Browse other questions tagged or ask your own question.