Saturday, October 30, 2010

Create Tar file and unpacking of Tar File.

Create TAR File

$ tar -cvf archivename.tar name_of_file
     v - provides a descriptuion of archived contents (optional)
     c - to create an archive
     f -  to specify a name for the archive
     archivename.tar -- name given to the archive
     name_of_file    -- name of folder or directory to be archived.
e.g tar -cvf tech_st.tar tech_st

Unpacking the TAR File

 $ tar -xvf archivename.tar
      v - provides the contents of the unpacked files
      x - to extract files
      f - designate the archive containing the files.
      arhivename.tar - the name of the archive to retrieve.

  e.g $ tar -xvf tech_st.tar

Create zipped tar ball

     # tar -cvf temp.tar tmp
     # /usr/contrb/bin/gzip temp.tar
     This creates temp.tar.gz
      You can then copy to any directory you want.

 To Uncompress zipped tar ball
     # cd /directory_you_want
     # /usr/contrib/bin/gunzip temp.tar.gz
     # tar -xvf temp.tar
     # ll tmp

No comments:

Post a Comment