![]() |
How to creat a Tar Ball
Hi:
First time attempting "creating a tarball" and having trouble understanding what the terminal needs. Read this page to help myself: http://www.cyberciti.biz/faq/creatin...-command-line/ I'm wondering what else should be executed and what directory is generally the desired one to untar things in? I went to my Home folder and created a new file 'TARS' I than created a new empty document and titled it 'Practice' This is what I have so far but have not a clue what the next step is that I should be initiating or what else I need to do- Code:
ztcoracat:~$ tar cvzf tarfile.tar.gz TARSDoes that depend on what directory I am in at the present or does that need to be indicated at the end of the new tar cmd ? Like so: Quote:
|
Hi,
the tar-ball will be put exactly where you tell it to be put. In your example it will be put in the current directory (in that case your home directory). If you want to it to go somewhere else just specify it. Eg to put it in /tmp: Code:
ztcoracat:~$ tar cvzf /tmp/tarfile.tar.gz TARSEvo2. |
Thanks evo ;)
Quote:
Is there a better suited directory other than downloads for this tarball? |
Hi,
Quote:
Evo2. |
Quote:
Could you recommend a tarball that I could go and download from the internet and check the 'Read Me' or 'Install' file to understand where I should untar? |
Hi,
Quote:
Evo2. |
Quote:
I understand now how to create a tarball. Now I just need to learn how to unzip or extract it- I went to the tarfile.tar that I made and opened my home directory. Upon opening the home directory I right clicked on my newly created tar and the drop down menu gave me: -open with Archive Manager -make link -rename -encrypt -Send to -Extract here..... Do I choose Extract here or open the terminal and use this cmd? Code:
tar -zxvf (nameoftar) tar.gz |
Just try it :)
Basic cmd Code:
tar -zxvf file.tar.gzThat cyberciti link of yours pretty much covers the basics, but there's a lot more possibilities. |
Code:
ztcoracat:~$ tar -zxvf tarfile.tar.gz |
Code:
tar (child): file.tar.gz: Cannot open: No such file or directory !!Incidentally, tar is just a generic archiving tool. The content can be anything, so you have to un-tar it to find/read the (content specific) docs (if any ...) |
Quote:
Thanks for that link. That man-page helps and I now understand and things make more sense;) What directory do most folks untar in? (or) does (like Evo said) depend on what it is? |
Pretty much yes...
Normally if you're eg installing some tool, then the web page will make a recommendation. Alternately, I usually go for /opt/. This is just to unroll the tar file. Once its unpacked, the accompanying docs (if any) usually tell whether you can specify final install dir (if you can change it). Typically for a src code set (usually in C), you invoke the make cmd and specify a config prefix; see the docs. If its a backup you made, you should know where to put it :) Check the -P option if you are doing this ;) Basically, as you can see, there's a LOT of options to this cmd. Easiest is to google through a load of examples and check the flags used until you feel comfortable. |
I don't like using “z” option. Much easier to use “a” (auto) and specify compression by extension (you won't need to remember all options for all compression methods):
Code:
tar cavf this-is-my-ultra-compressed-archive.tar.xz file1 file2 fil3 some-dir
They all have different letters as options (“-z”, “-j”, “--lzma”, “-J”) but “a” will work for all. |
Chrism01 & Mr. Alex:
I wrote everything down that you posted- - Thank you both; very much!:) |
Actually most (all?) of those tools have an option to specify how efficiently to compress (usually a range from 1 - 9, default 6), so those comparisons don't follow.
As for switches, if I can remember the correct file extension, I reckon I can remember the matching switch :) Besides, most people pick a compression tool/option & use the same one most of the time. |
| All times are GMT -5. The time now is 02:00 PM. |