Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a problem with zipping files in .tar file in Linux, but the challange is that when we extract .tar file it shouldn't give us a folder containing files which are zipped . It should give just files which we zipped in .tar file. How to do that? thanks!

share|improve this question

migrated from stackoverflow.com Apr 30 '12 at 16:11

This question came from our site for professional and enthusiast programmers.

    
What command are you using for zipping/unzipping? – Neil Apr 30 '12 at 14:50
    
i use tar -cvwf filename.tar filenamesss – Sahil Gadimbayli Apr 30 '12 at 15:01
    
Also note that when you are talking about use of tar, it's more commonly referred as "tarring/untarring", not zipping/unzipping which is confusing (to me at least) – Stan Apr 30 '12 at 22:37

See the --strip-components flag. (But I strongly suggest you don't do this, it is expected that a tarball will have a single top level directory inside it).

share|improve this answer

If I understand your question correctly, you should be able to use:

tar cvf <tarfile name> <filename1> <filename2> <filename3>

When you extract the files, they should extract into the current directory.

share|improve this answer

You must log in to answer this question.