Hello Henry hope you are well.
If you need to compress a folder just fire the below command:
Quote:
tar cf dir.tar dir/
tar czf dir.tar.gz dir/
tar cjf dir.tar.bz2 dir/
|
Here the first command will be generating a normal .tar file
The secound command will generate a tar.gz (which you want to do ) and the last command will generate .tar.bz2.
Ok now lets come to the description of the above command that is each options like 'c' , 'z' ,'f'
Quote:
-c, --create is used to create a new archive
-f, --file [HOSTNAME:]F use archive file or device F
-z, --gzip, --ungzip filter the archive through gzip,
|
Now let see how to extract or unzip the files
To unzip or extract just fire the below command:
Quote:
tar xf dir.tar
tar xf dir.tar.gz
tar xf dir.tar.bz2
|
Quote:
|
Here -x, --extract, --get extract files from an archive
|
Thats it!! Hope this information helps you.
