Archive for April, 2008

Linux TAR Command

April 4, 2008

Quick Start: Here we’l present quick start examples explained.

Create linux tar gz (Gzip) archive

tar -czvf myarchive.tgz mydirectory/

We use the -t option to create an linux tar archive
-c, –create                      create a new archive

Note that .tgz is the same thing as .tar.gz

Create linux simple tar archive (withouth compresion)

tar -cvf myarchive.tar mydirectory/

Extracting linux tar archive:

Extract linux tar gz (Gzip) archive
tar -xzvf mystuff.tgz

Extract linux simple tar archive
tar -xvf mystuff.tar

We use -x to extract the files form the tar archive
-x, –extract, –get    extract files from an archive

And now let us shortly explain this command

Usage: tar [OPTION]… [FILE]…

Let us check the option used in this example

-c, –create                      create a new archive
-z, –gzip, –ungzip        filter the archive through gzip
-v, –verbose                   verbosely list files processed
-f, –file=ARCHIVE          use archive file or device ARCHIVE

Testing / viewing your archive

tar -tvf myarchive.tar
tar -tzvf myarchive.tgz

Here we used the - t opton
-t, –list                           list the contents of an archive

————————————————-

Go ahead, try out these commands and stay tuned; we will come up with more doccumentation on linux tar command

Why basic Linux Commands ?

April 3, 2008

Because I for one, am not a Linux or UNIX guru, and still need to use Linux and Linux basic (or not so basic) commands.

So I decided to gather all the articles about simple Linux and UNIX commands, in one place. linuxbasiccommands.wordpress.com will be the place for there articles. Stay tuned, I will update frequently.