LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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


Reply
  Search this Thread
Old 01-22-2005, 06:30 PM   #1
foxele
LQ Newbie
 
Registered: Oct 2004
Location: san diego
Posts: 7

Rep: Reputation: 0
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
 
Old 01-22-2005, 06:33 PM   #2
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
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.
 
Old 01-22-2005, 06:43 PM   #3
rtspitz
Member
 
Registered: Jan 2005
Location: germany
Distribution: suse, opensuse, debian, others for testing
Posts: 307

Rep: Reputation: 33
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
 
Old 01-24-2005, 04:44 AM   #4
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: Mint, Armbian, NetBSD, Puppy, Raspbian
Posts: 3,516

Rep: Reputation: 240Reputation: 240Reputation: 240
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
 
Old 01-24-2005, 05:33 AM   #5
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Read, Print Unix Commands? gopikrish Linux - General 1 12-11-2004 02:07 PM
funny unix csh/sh commands darkRoom General 0 03-16-2004 05:25 PM
Limit unix commands of a user ID thedragon Linux - Security 3 07-16-2002 08:37 PM
Basic Unix commands req dark_light Linux - Newbie 7 04-04-2002 06:33 PM
Good book on UNIX commands psyklops Linux - General 7 01-26-2002 08:30 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration