zip all directories questions

Discussion in 'Programming' started by Adulu, Apr 24, 2009.

  1. #1
    Using linux

    my question
    there are many directories how to zip all in one command and which output each zip
    example:
    1directory-->1directory.zip
    2directory-->2directory.zip
    3directory-->3directory.zip
    4directory-->4directory.zip
    .....etc


    thank you
     
    Adulu, Apr 24, 2009 IP
  2. NuLLByTe

    NuLLByTe Active Member

    Messages:
    382
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    80
    #2
    
    cd where_the_folders_are
    for i in *; do tar -czvf $i.tgz $i; done
    
    Code (markup):
     
    NuLLByTe, Apr 25, 2009 IP
  3. Adulu

    Adulu Peon

    Messages:
    2,791
    Likes Received:
    43
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks so much
    it's work
     
    Adulu, Apr 25, 2009 IP