Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

zipping files

Posted on 1997-08-29
8
Medium Priority
?
314 Views
Last Modified: 2010-04-21
Is there a command to have all my html files zipped up for storage andr future download (copys not add/delete)?
0
Comment
Question by:bstorm
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
8 Comments
 
LVL 84

Expert Comment

by:ozo
ID: 2006883
zip html.zip *.html

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


0
 
LVL 2

Accepted Solution

by:
theTerabyte earned 100 total points
ID: 2006884
I always forgot the command to unzip them- you'll need that too!
if you use the tar command to compress them, use this command to uncompress them:
tar -xvf html.tar.gz /target_path
hope you feel like giving up some points for this tidbit sccince ozo gave the ans away(like 10 or 20) but you don't have to obviously.

HOPE THIS HELPS!  Terabyte
0
 
LVL 84

Expert Comment

by:ozo
ID: 2006886
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 -)

0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 2

Expert Comment

by:theTerabyte
ID: 2006887
had to oneup me, eh?  oh well, i don't know as much about UNIX as i'd like to anyway....
0
 
LVL 84

Expert Comment

by:ozo
ID: 2006888
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...

 

0
 

Author Comment

by:bstorm
ID: 2006889
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...
0
 
LVL 84

Expert Comment

by:ozo
ID: 2006890
> 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?
 
0
 

Author Comment

by:bstorm
ID: 2006891
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.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Suggested Courses

596 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question