My First Post      My Facebook Profile      My MeOnShow Profile      W3LC Facebook Page      Learners Consortium Group      Job Portal      Shopping @Yeyhi.com

Pages










Showing posts with label zip. Show all posts
Showing posts with label zip. Show all posts

Thursday, January 3, 2019

Packing and unpacking tar/gzip files on Windows


A few years ago I wrote a similar blog for Linux. Refer https://www.w3lc.com/2011/06/tar-command-in-linux-to-archive-and.html. However, the question is again very relevant if your OS is Windows and its family. Hence this post.


Method 1: Using compression utility

First you compress it to tar with 7-zip and then to gzip with 7-zip.
You u can do using their UI or command line support provided by them.

Following is the example if you want to use 7z tool or its dll:

  • Create .tar.gz: 7z a -ttar -so dwt.tar dwt/ | 7z a -si dwt.tar.gz
  • Extract .tar.gz: 7z x dwt.tar.gz -so | 7z x -si -ttar



Method 2: Using bash shell on Windows like UnixUtils or any other Bash of Ubutu etc on Windows.

If installed, make a directory and proceed as follows:
cd /mnt/c/[path to folder to archive]
tar -pczf archive.tar.gz *
In fact, if you notice this approach is similar to my earlier blog for Windows.


Method 3: Write your own subroutine/function to generate a Zip file.

Yeah! you can do it. Thousands of companies do it. And you can find open source solutions as well. Because these formats are in any case open source! Pretty easy :)


Method 4: Extending method 1 more, you can use Gzip for Windows - GnuWin32. This utility has command line version as fell. Refer http://gnuwin32.sourceforge.net/packages/gzip.htm

Wednesday, February 22, 2012

Check corrupt ZIP file. Integrity, CRC, and Repair too!!

Hi,
This post deals with the corruption that may have creaped into your Zip (or other files like rar, doc, excel, file. During download, or due to some intentional malformation, your zip file may not work properly. You can use following tools to revisit your archived files in zip format.
These tools may prove very useful and handy during your testing process also, in case your tool is not acting in expected manner with some Zip file.

You can visit Recovery Tool Official Website
I have personally found these useful.

Recovery and Repair tools for Zip, RAR, Excel, Outlook, word etc

Tools in discussion are as follows:
1. Recovery Toolbox for Zip - an efficient remedy for damaged zip files
2. Recovery Toolbox for Outlook
3. Recovery Toolbox for RAR
4. Recovery Toolbox for PDF
5. etc etc

Check out more at the given site.

PS: There are several other companies offering such tools. You can judge which is better before buying. These are my choices though!!

Thursday, June 30, 2011

Tar command in Linux [additional notes in Freebsd] to archive and extract contents (तार कमांड इन लिनुक्स)

'tar' command in linux is used to make archive and also to extract from the tar archive. Actually TAR is a file compression format and linux supports it very well. It is also used synonymously with TGZ sometimes. The same 'tar' command is used to create as well as extract from a tar.


A) To Create linux tar gz (Gzip) archive
tar -czvf myarchive.tgz mydirectory/
-c, –create create a new archive

In Freebsd there is no -v -z options so simple command like :
tar -cf would do it.

If you use -w , then it will prompt you at every file. -v will give you a verbose output at each line.

It is important to note that .tgz is the same thing as .tar.gz


B)To Create linux simple tar archive without any compression
tar -cvf myarchive.tar mydirectory/


C) For Extracting linux tar archive:
tar -xzvf mystuff.tgz
-x tells to extract the files form the tar archive
You can remove z if it is a simple tar file.

There are a lot more options available that you can get to know using man or --help. Also, a good book on linux will help you learn more on file compression decompresion and tar zip commands etc. The things i mentioned, will suffice your daily needs anyways. Cheers ;)