![]() ![]() # Returns a StringIO whose underlying String # Creates a tar file in memory recursively OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, IN NO EVENT SHALL THEĪUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,įITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR The above copyright notice and this permission notice shall be included inĪll copies or substantial portions of the Software. To use, copy, modify, merge, publish, distribute, sublicense, and/or sellĬopies of the Software, and to permit persons to whom the Software isįurnished to do so, subject to the following conditions: In the Software without restriction, including without limitation the rights Of this software and associated documentation files (the "Software"), to deal For more information on using the tar command, see my Linux tar command examples.Permission is hereby granted, free of charge, to any person obtaining a copy I hope this tar/gzip tutorial has been helpful. ![]() ![]() Once I learned that I could tar and gzip a file with one command I stopped using this two-step process, but again, either way will work. This is a two-step process - and the way I used to do this - that works like this:Īs a practical matter you can treat a tar.gz file just like a tgz file, and extract its contents using the same command that was shown earlier: When you see this ".tar.gz" file extension, it indicates that the file has probably been tar'd first, and then gzip'd second. This command lists the contents of the archive, but does not extract the files in the archive to your filesystem.Īs you work in the Unix world you'll also run into files named with a "tar.gz" extension, like this: If this is an archive you just received from someone else, you may want to look at its contents before just extracting it to your filesystem.įortunately you can list the contents of an archive very easily, using the t option ("lisT") instead of the x argument, like this: If that previous command sounded scary, maybe it should be. This command extracts whatever was in that tar'd and gzip'd archive to your filesystem.ģ) List the contents of a tar/gzip archive To extract the contents of the archive issue a very similar command, this time using an x (for "eXtract") instead of the c argument, like this: Now imagine that you have just received a tar/gzip archive like this from someone else. When creating an archive that has been tar'd and gzip'd, this is considered a "tar tgz" file, so it's common practice to end your filename with the extension tgz (though you can call it whatever you want).Ģ) Extract the contents of a tar/gzip (tar tgz) archive f - specifies that you want to use the following filename ( mydirectory.tgz) as the name of the archive.v - work verbosely, showing me the name of each file you add.I've included four options with the tar command: Here's how you create a tar'd and gzip'd archive of a directory (i.e., a "tar tgz" file) in your current folder named mydirectory:Ī few quick notes about this tar/gzip example: The most common way to do that these days is to create an archive that is "tar'd and gzip'd". Here's a quick look at how to work with the most common tar/gzip scenarios.ġ) Create a tar'd and gzip'd archive of a directoryĪ lot of times you'll have a directory that you want to either (a) make a backup copy of, or (b) share with other people. When you work on Unix, Linux, and Mac OS X systems, you'll quickly find that tools like tar and gzip are your good friends, so learning how to work with them is very important. Tar gzip FAQ: How do I work with tar archives that have been created with tar and gzip? ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |