Sunday, November 13, 2022

TAR.GZ TGZ Extractor Command Line


    7z x "somename.tar.gz" -so | 7z x -aoa -si -ttar -o"somename"

Explain:

  • x = Extract with full paths command
  • -so = write to stdout switch
  • -si = read from stdin switch
  • -aoa = Overwrite all existing files without prompt.
  • -ttar = Treat the stdin byte stream as a TAR file
  • -o = output directory

  • Saya telah menguji dan menerapkannya kedalam skrip batch seperti di bawah:

      @echo off
      :main
      mode con:cols=63 lines=120
      cls
      title TGZ EXTRACTOR
      echo  *************************************************************
      echo   It's for extract a file with "TGZ" file-type extension.
      echo   If yours is "gz", rename first before doing this operation.
      echo  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
      echo.
      set /p tgz=" Input a tgz file here: "
      set /p out="Input destination directory: "
      7z x "%tgz%" -so | 7z x -aoa -si -ttar -o"%out%"
      echo  -------------------------------------------------------------
      paue > %temp%\nul | echo Yen pengen ngekstrag maleh, Tekan sembarang tombol keyboard
      goto main
    

    Source: How can i unzip a tar gz in one step using 7-zip

    No comments:

    Post a Comment