Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

2 Answers

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
add comment

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.