Linux dudes need help. need to zip on the server 20 folders

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • datatank
    Confirmed User
    • Aug 2004
    • 5471

    #1

    Linux dudes need help. need to zip on the server 20 folders

    I have 20 folders on a linux box and I need to zip the contents of each folders into folder name.zip Does anyone now the command?


    Thanks
  • TexasDreams
    former Miserable Admin :)
    • Oct 2003
    • 4700

    #2
    Originally posted by datatank
    I have 20 folders on a linux box and I need to zip the contents of each folders into folder name.zip Does anyone now the command?


    Thanks
    Use a tar -cvf type command.

    http://www.asu.edu/it/fyi/dst/helpdo.../disk/tar.html

    ICQ: 168-914-369 >>> sysop [at] TexasDreams [dot] com

    Comment

    • High Plains Drifter
      Confirmed User
      • Jun 2005
      • 2341

      #3
      man zip

      ....

      Comment

      • BigBen
        Confirmed User
        • Nov 2004
        • 2299

        #4
        Originally posted by TexasDreams
        After you do that, do a gzip to compress your archive and you now have .tar.gz

        Comment

        • Meorazhar
          Confirmed User
          • May 2005
          • 672

          #5
          go to that folder and issue this command
          Code:
          zip -r name.zip .

          Comment

          • datatank
            Confirmed User
            • Aug 2004
            • 5471

            #6
            I need a .zip not a tar

            Comment

            • TexasDreams
              former Miserable Admin :)
              • Oct 2003
              • 4700

              #7
              Originally posted by datatank
              I need a .zip not a tar
              Grab winRAR. Beats the crap out of limiting yourself to just zip files!

              http://www.download.com/3000-2250-10007677.html

              ICQ: 168-914-369 >>> sysop [at] TexasDreams [dot] com

              Comment

              • Doc911
                Confirmed User
                • Feb 2004
                • 3695

                #8
                Originally posted by datatank
                I have 20 folders on a linux box and I need to zip the contents of each folders into folder name.zip Does anyone now the command?


                Thanks
                bin/bash/slapaho/zip -balls_caught_in_zipper

                seriously though why zip when you can tar?


                For PHP/MySQL scripts ICQ 161480555 or email [email protected]

                Comment

                • datatank
                  Confirmed User
                  • Aug 2004
                  • 5471

                  #9
                  im sorry. My problem is I have a script in the server that needs zips

                  Comment

                  • Kyo
                    Registered User
                    • Jul 2005
                    • 87

                    #10
                    Originally posted by datatank
                    im sorry. My problem is I have a script in the server that needs zips
                    Go to the top level directory (the one that contains the subdirs you wanna zip up), and give this command:

                    find . -type d -maxdepth 0 -exec zip -ur {}.zip {}/* \;

                    The find command will start in your current working directory (.), look for all things that are directories (-type d), and for each, it will execute (-exec ... \;) the command given, substituting {} for the name of the directory found. The -maxdepth 0 makes sure it doesn't go into the subdirectories recursively.

                    The command (zip -ur) does the standard update/recursive zip.

                    do a "man find" and a "man zip" to fine tune the options.
                    Last edited by Kyo; 09-20-2005, 12:22 AM.

                    Comment

                    • Kyo
                      Registered User
                      • Jul 2005
                      • 87

                      #11
                      Originally posted by Kyo
                      find . -type d -maxdepth 0 -exec zip -ur {}.zip {}/* \;
                      Err, make that "-maxdepth 1". Sorry.

                      Comment

                      Working...