Archive files using command tar

Post date: Oct 17, 2014 8:04:03 AM

Unzip archived files using tar. This command unzips all the files archived in the .zip into the working directory.

tar xvf alldata_log_score.zip

If only a specific file is needed, we can specify only the file we want to extract (e.g. data/modeldata/na_alldata.sas7bdat):

tar xvf alldata_log_score.zip data/modeldata/na_alldata.sas7bdat

You can extract the file into a different directory using "-C <path to another dir>"

tar xvf alldata_log_score.zip data/modeldata/na_alldata.sas7bdat -C ./

references

basic using tar -- http://www.computerhope.com/unix/utar.htm

extract tar to a different directory -- http://www.linuxquestions.org/questions/linux-newbie-8/tar-extract-to-different-directory-495715/