Total Pageviews

Tuesday, August 26, 2014

how to tar and gn together linux command tar -cvzf to untar use zxvf


use following command to tar domain folder. u need to be outside of domain folder in order to tar and gz it

tar cvzf ./domain.tar.gz ./domain


or
tar czvf  filename.tar.gz  /folder-path


to untar above file

tar -zxvf ./domain.tar.gz ./domain

Where,
  • -z : Uncompress the resulting archive with gzip command.
  • -x : Extract to disk from the archive.
  • -v : Produce verbose output i.e. show progress and file names while extracting files.
  • -f data.tar.gz : Read the archive from the specified file called data.tar.gz.
By defaults files will be extracted into the current directory. To change the directory use -C option. In this example, extract files in /data/projects directory:
 
tar -zxvf data.tar.gz -C /data/projects

No comments:

Post a Comment