Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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 TARS
TARS/
TARS/Practice
ztcoracat:~$
Where will Debian put this tar-ball that I have created and any other tar that I create in the future?
Does 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:
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 TARS
Regarding where to untar things, that depends entirely on what it is you are untaring.
that depends entirely on what it is you are untaring.
Let's say for example I download a tarball and it is an application that I want to install.
Is there a better suited directory other than downloads for this tarball?
Let's say for example I download a tarball and it is an application that I want to install.
Is there a better suited directory other than downloads for this tarball?
Hmm, still depends on what it is, and who will be using it. For example, a common place for prepackaged binaries like this might be /opt/, or perhaps if it is only for one user, in that users home directory, or even ~/opt/. If the package follows the FHS then perhaps /usr/local or if just for a single user ~/local. It is always best to check the documentation for whatever it is you are untarring/installing.
It is always best to check the documentation for whatever it is you are untarring/installing.
Agreed-
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?
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?
sorry no. I'm happy to help you with specific problems, but I'm not going to generate homework exercises for you.
sorry no. I'm happy to help you with specific problems, but I'm not going to generate homework exercises for you.
Evo2.
This is not homework I am in my late 50's- and retired- -
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?
Have a read of http://linux.die.net/man/1/tar and basically play with the options.
That cyberciti link of yours pretty much covers the basics, but there's a lot more possibilities.
ztcoracat:~$ tar -zxvf tarfile.tar.gz
TARS/
TARS/Practice
ztcoracat:~$ tar -zxvf file.tar.gz
tar (child): file.tar.gz: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
ztcoracat:~$
I know it's not a good practice to assume but I'll assume the first try was correct because I used the name (tarfile) that I gave.
tar (child): file.tar.gz: Cannot open: No such file or directory !!
Obviously you can't just make stuff up
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 ...)
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
*.tar.gz for gzip (poor compression)
*.tar.bz2 for bzip2 (middle compression)
*.tar.lzma for LZMA (best compression)
*.tar.xz for XZ (best compression)
They all have different letters as options (“-z”, “-j”, “--lzma”, “-J”) but “a” will work for all.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.