Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
01-22-2005, 06:30 PM
|
#1
|
LQ Newbie
Registered: Oct 2004
Location: san diego
Posts: 7
Rep:
|
question about unix commands
Hello:
I have two questions about unix commands.
1. if I have a complete directory structure to send to someone. Which command is most suitable for the task. and how to do it?
2. If I have a number of picture files having the .gif extension. which command should I use to compress them?
thanks
|
|
|
01-22-2005, 06:33 PM
|
#2
|
Senior Member
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Rep:
|
I'd use tar to do both tasks.
tar -cjf <tarballname.tar.bz2> <directory-to-tar>
The j in -cjf compresses using bz2 compression. If you change it to z it will use gzip compression instead.
|
|
|
01-22-2005, 06:43 PM
|
#3
|
Member
Registered: Jan 2005
Location: germany
Distribution: suse, opensuse, debian, others for testing
Posts: 307
Rep:
|
pack some folder:
Code:
tar -czvf file-to-send.tgz /path/somefolder/anotherfolder
this will tar and gzip all contents of the given path.
uncompress with:
Code:
tar -xzvf file-to-send.tgz
|
|
|
01-24-2005, 04:44 AM
|
#4
|
Senior Member
Registered: Mar 2004
Location: england
Distribution: Mint, Armbian, NetBSD, Puppy, Raspbian
Posts: 3,516
|
not sure if there's anything to gain from compressing a gif?
they already compresed:
here's an example, the gzipped file is larger
18654 Jan 24 10:41 demopic.gif.gz
18619 Jan 24 10:41 demopic.gif
|
|
|
01-24-2005, 05:33 AM
|
#5
|
Senior Member
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113
Rep: 
|
That's overhead on a small file - if it's a lot of gifs, there's still some redundancy to be squoze out of 'em  so it should be smaller or, at worst, about the same. But yeah, gzipping isn't worth the time, cycles, and potential for error - might as well just tar 'em up.
|
|
|
All times are GMT -5. The time now is 12:21 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|