Solved

compress and decompress

Posted on 2006-11-07
1
303 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 500 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

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

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 …
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
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.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

717 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