GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Linux dudes need help. need to zip on the server 20 folders (https://gfy.com/showthread.php?t=518462)

datatank 09-19-2005 11:17 PM

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 09-19-2005 11:30 PM

Quote:

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. :thumbsup

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

:)

High Plains Drifter 09-19-2005 11:31 PM

man zip

....

BigBen 09-19-2005 11:32 PM

Quote:

Originally Posted by TexasDreams
Use a tar -cvf type command. :thumbsup

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

:)

After you do that, do a gzip to compress your archive and you now have .tar.gz :thumbsup

Meorazhar 09-19-2005 11:33 PM

go to that folder and issue this command
Code:

zip -r name.zip .

datatank 09-19-2005 11:44 PM

I need a .zip not a tar :)

TexasDreams 09-19-2005 11:47 PM

Quote:

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

:2 cents:

Doc911 09-19-2005 11:49 PM

Quote:

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?

datatank 09-19-2005 11:51 PM

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

Kyo 09-20-2005 01:19 AM

Quote:

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.

Kyo 09-20-2005 01:23 AM

Quote:

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

Err, make that "-maxdepth 1". Sorry. :)


All times are GMT -7. The time now is 05:16 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123