The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM
Home Forums Register Rules & FAQ Members List Arcade Search Today's Posts Mark Forums Read


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!


Other UNIX.COM Threads You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Copy Compress as one command findprakash UNIX for Dummies Questions & Answers 9 11-28-2007 07:44 PM
mv and compress on the fly simquest UNIX for Dummies Questions & Answers 1 02-22-2007 08:51 AM
SSH Compress Commands kushti UNIX for Dummies Questions & Answers 2 08-13-2006 02:12 PM
tar and compress muru UNIX for Advanced & Expert Users 4 07-31-2006 05:23 PM
Compress and copy a Folder scorpiyanz UNIX for Advanced & Expert Users 1 08-19-2005 10:53 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-28-2005
Registered User
 

Join Date: Nov 2003
Posts: 52
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
Copy and compress

Is there a way to copy a file and compress it at the same time?

I realize the file can be copied and then compressed, but I was wondering if it's possible to do it in a one-line command and for that matter, if it would be more efficient to perform the operation with a one-line command?

Thanks.
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 11-28-2005
Registered User
 

Join Date: Nov 2001
Location: Flint, MI
Posts: 158
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
Maybe this link will help:
Backup single large file
Reply With Quote
  #3 (permalink)  
Old 11-29-2005
Registered User
 

Join Date: Nov 2003
Posts: 52
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
Thanks JYOUNG. That allowed me to accomplish the task albeit not with a one-line command.

It appears that copying & gzipping thru a pipe isn't any faster than copying, gzipping & moving a 120MB file.

Guess I'll stick w/ the non-PIPE procedure.

Last edited by here2learn : 12-03-2005 at 02:59 PM.
Reply With Quote
  #4 (permalink)  
Old 11-29-2005
Ygor's Avatar
Moderator
 

Join Date: Oct 2003
Location: -31.96,115.84
Posts: 1,206
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
Not sure that you need a pipe, perhaps try...
Code:
gzip < /path/to/file1 > /path/to/file1.gz
Reply With Quote
  #5 (permalink)  
Old 11-30-2005
Registered User
 

Join Date: Nov 2003
Posts: 52
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
That's what I was looking for !! MAN, for the life of me, I can't believe I didn't remember that option. Bet I won't forget it next time.

It seems the the times are approximately the same for all three methods, however Ygor's method does provide the one-line code I was looking for and prevents having to remove any named-pipe.

Thanks Ygor !!
Reply With Quote
Google UNIX.COM
Reply



Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -7. The time now is 11:55 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger

Search Engine Optimization by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102