Click here to read this mailing online.

Your email updates, powered by FeedBlitz

 
Here are the latest updates for tgrkurniawan7@gmail.com


 

JAUHARI | Everything Is POSSIBLE

"JAUHARI | Everything Is POSSIBLE" - 1 new article

  1. How To Using tar to Archive Data and Folder
  2. More Recent Articles
  3. Search JAUHARI | Everything Is POSSIBLE
  4. Prior Mailing Archive

How To Using tar to Archive Data and Folder


JAUHARI.net has been move from one server to another server more than five times. And tar command is my favorite ways  to move our website data from one server to another server. Okay.. here is the ways how to using tar to Archive Data and Folder





Using Tar Command

Using Tar Command

The program tar (originally for tape archive) is useful for archiving and transmitting files that available on Unix Family Operating System. Almost every Linux Installed Server already have tar program.

If you want to move your server data using tar command you need telnet/ssh enabled. If you hosting provider SSH didn’t activated you can request  to enable it.I will explain a little bit more about many useful tar command. This information taken from Owen L. Astrachan on this page

Create, Extract, See Contents

The tar program takes one of three function command line arguments (there are two others I won’t talk about).

  • c — to create a tar file, writing the file starts at the beginning.
  • t — table of contents, see the names of all files or those specified in other command line arguments.
  • x — extract (restore) the contents of the tar file.

(the other options are u for update and r for replace, see the man page for details).

Exactly one function argument, c, t, x, is used in conjunction with other command line arguments shown below. Again, these examples are not meant to be complete, just useful.

Compression, Verbose, File specified

In addition to a function command line argument the arguments below are useful. I usually use z and f all the time, and v when creating/extracting.

  • f — specifies the filename (which follows the f) used to tar into or to tar out from; see the examples below.
  • z — use zip/gzip to compress the tar file or to read from a compressed tar file.
  • v — verbose output, show, e.g., during create or extract, the files being stored into or restored from the tar file.

Examples Tar Command

To tar all .cc and .h files into a tar file named foo.tgz use:
tar cvzf foo.tgz *.cc *.h
This creates (c) a compressed (z) tar file named foo.tgz (f) and shows the files being stored into the tar file (v). The .tgz suffix is a convention for gzipped tar files, it’s useful to use the convention since you’ll know to use z to restore/extract.

It’s often more useful to tar a directory (which tars all files and subdirectories recursively unless you specify otherwise). The nice part about tarring a directory is that it is untarred as a directory rather than as individual files.

tar cvzf foo.tgz cps100

will tar the directory cps100 (and its files/subdirectories) into a tar file named foo.tgz.

To see a tar file’s table of contents use:

tar tzf foo.tgz

To extract the contents of a tar file use:

tar xvzf foo.tgz

This untars/extracts (x) into the directory from which the command is invoked, and prints the files being extracted (v).

If you want to untar into a specified directory, change into that directory and then use tar. For example, to untar into a directory named newdir:

mkdir newdir cd newdir tar xvzf ../foo.tgz

You can extract only one (or several) files if you know the name of the file. For example, to extract the file named anagram.cc from the tarfile foo.tgz:

tar xvzf foo.tgz anagram.cc

That’s it, now you can trying in your hosting provider with SSH/Telnet. We hope this tutorial about using tar program with many example command will be useful. We will show you how to move website data to another server easily using Tar Command on the next post.

How To Using tar to Archive Data and Folder is a post from: JAUHARI

Related posts:

  1. Download YouTube video using Command Line
  2. Setup Multiple site on Apache 2
  3. How To Change Hostname On Linux

 

More Recent Articles


Free Shipping and Free Returns


Click here to safely unsubscribe now from "JAUHARI | Everything Is POSSIBLE" or change your subscription, view mailing archives or subscribe

 
Unsubscribe from all current and future newsletters powered by FeedBlitz
Your requested content delivery powered by FeedBlitz, LLC, 9 Thoreau Way, Sudbury, MA 01776, USA. +1.978.776.9498