Link to home
Start Free TrialLog in
Avatar of bstorm
bstorm

asked on

zipping files

Is there a command to have all my html files zipped up for storage andr future download (copys not add/delete)?
Avatar of ozo
ozo
Flag of United States of America image

zip html.zip *.html

tar cBf - *.html | gzip > html.tar.gz


ASKER CERTIFIED SOLUTION
Avatar of theTerabyte
theTerabyte

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Or if you don't have a tar that knows about .gz files, you might use:

zcat html.tar.gz | (cd /target_path; tar xBf -)

Avatar of theTerabyte
theTerabyte

had to oneup me, eh?  oh well, i don't know as much about UNIX as i'd like to anyway....
No, I learned something too.
I just noticed in the gzip man pages a mention that gnu tar
has a -z option for compressed archives...

 

Avatar of bstorm

ASKER

here's part of the telnet log...
rapidnet: {6} % zip html.zip *.html
zip: No match.
rapidnet: {7} % tar cBf - *.html | gzip > html.tar.gz
tar: No match.
rapidnet: {8} % man gzip ....so..neither of these worked...will read the manual when I get a chance...
am quite afraid of creating a Zip that will replace them instead of merely adding them to an arcive...couldn't get this to oze...
> rapidnet: {6} % zip html.zip *.html
> zip: No match.
This error looks like it means that there are no *.html files in your cwd
are the files named *.html?

What if you say
zip html.zip pathtohtmlfiles/*.html
?

or
cd pathtohtmlfiles
zip html.zip *.html

But is your fear that it will replace files already in an exixting zip archive?
I had previously understood your fear to be that it would
remove the original files when it created the archive.

In either case, perhaps your fear could be aleviated by making
a copy in another directory of the files you don't want to be
overwritten?
 
Avatar of bstorm

ASKER

ozo deserves the grade of A ..as his answer was correct, I hadn't changed directories to where they were, but when I did, his command worked perfectly. For some reason I can't give ozo the credit, so this will make 100 points spent trying to get him his credit.