Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's 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 wouldn't say I'm completely new to linux, as I've been using various distros for several years now (JoliOS, ubuntu, lubuntu, mint).
Admittedly, I"m not very savvy (though I'm getting better) with the comand line. One thing that has constantly confounded me is executing tar.gz and tar.bz2 files. Most of the videos and advice online meant for newbies, frankly, can be impenetrable to newbies.
I am determined to get it, and, once I do, am really thinking about doing a youtube video that explains in as plain language as possible. I believe that tarball files are one of the potentially biggest obstacles to more folks staying with linux, so I want to offer a really easy-to-follow list of instructions for how to execute these files.
Would anyone be willing to 'dumb it down' for me and walk me through how to execute tarballs? This, again, both so I can learn it myself and to put that learning into what I hope will be an easy-to-follow-for-new-linux-users video. (I'll give you credit in the video, of course.)
tar files are archive files, they are not executables, they are storage archives.
Extensions for them such as bz2 or gz simply mean that they are zipped using some type of compression tool.
With tar, here are "my" shortcuts that I've retained over the years. And this is all command line, not UI and double clicking and such. (Meanwhile if you double click on a zipped tar file, or just a tar file, it will open an archive management tool to allow you to extract the files and put them somewhere.
Tar notes:
tvf
xvf
cvf
The "vf" means output information using verbose and follow directories downwards. Therefore you'll "see" the information that occurs and you'll also retain a directory structure if you have a tar file which contains a directory tree. Having a directory tree of archived files is very commandcommon (edit fix).
"t" means to generate a report. Thus "tar tvf <filename>.tar.<zip-extension-if-any> will generate a report of the contents of the tar file.
"x" means to extract the files. "tar xvf <filename>" will extract the archived files.
"c" means to create a tar file. "tar cvf <tar-filename> <filename(s) to archive>" will create an archive.
You do not need to worry about unzipping a zipped file. Just run "tar xvf <tar-filename>"
You do not need to worry about specifying arguments to zip when creating a new archive, if you give an extension it will do this automatically.
"tar cvf sample.tar.bz2 <files ...>" will create a bz2 zipped filename as part of the archive process.
Same for various other zip extensions if you wish. You also do not have to zip the file at all if you don't want to.
To clarify a couple of points: The -f option names the file (or device) being acted upon. From man tar:
Code:
-f, --file=ARCHIVE
use archive file or device ARCHIVE
"device" of course, refers to the tape device when something is actually being written to tape.
And the -a,-z or -Z option needs to be added if the tar file is compressed. -a will use the suffix of the file name to determine the compression program.
so
Code:
tavf
xavf
cavf
if the archive file is compressed/to be compressed.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.