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 to compress only the contents of the folder, not the folder with tar, there is any argument for that? I have search but I don't find anything.

Example:

 mainfolder/
     asd1
     asd2
     subfolder/
     ....
     asdN

In my tar I want this:

  asd.tar.gz/
     asd1
     asd2
     subfolder/
     ....
     asdN
share|improve this question
up vote 3 down vote accepted

CD to "mainfolder" then execute

tar cvfz /path/your.tgz ./*
share|improve this answer
    
I want to do this out of this folder, because I am using a python script – tato469 Oct 17 '13 at 8:50
1  
finally I did using os.chdir() (That is like cd in python) thanks. Here your first check here and welcome :) – tato469 Oct 17 '13 at 8:53
1  
Why don't you use a python tar library? This is the more sophisticated way instead of using a system call. – noggerl Oct 17 '13 at 8:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .