?
Solved

compress and decompress

Posted on 2006-11-07
1
Medium Priority
?
305 Views
Last Modified: 2010-04-20
hello,
I need to compress 50 files from /home/pictures
and then extract them in /home/pictures2
but pictures2 has some files so I dont want to overwrite them!
how can I do this ?
0
Comment
Question by:Sabrin
[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
1 Comment
 
LVL 58

Accepted Solution

by:
amit_g earned 2000 total points
ID: 17894280
cd /home/pictures
tar -cf - * | gzip -c > all_files.tar.gz
cd /home/pictures2
gunzip -c all_files.tar.gz | tar -k -xf -

You might be able to do this in single command if you don't want to compress

tar -cf - -C /home/pictures . | tar -k -xpf - -C /home/pictures2

Always test on a smaller test directory before running it on real one.
0

Featured Post

AWS Certified Solutions Architect - Associate

This course has been developed to provide you with the requisite knowledge to not only pass the AWS CSA certification exam but also gain the hands-on experience required to become a qualified AWS Solutions architect working in a real-world environment.

Question has a verified solution.

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

Network Interface Card (NIC) bonding, also known as link aggregation, NIC teaming and trunking, is an important concept to understand and implement in any environment where high availability is of concern. Using this feature, a server administrator …
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month15 days, 6 hours left to enroll

741 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