![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | 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 !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Copy Compress as one command | findprakash | UNIX for Dummies Questions & Answers | 10 | 03-08-2009 01:19 PM |
| mv and compress on the fly | simquest | UNIX for Dummies Questions & Answers | 1 | 02-22-2007 12:51 PM |
| SSH Compress Commands | kushti | UNIX for Dummies Questions & Answers | 2 | 08-13-2006 05:12 PM |
| tar and compress | muru | UNIX for Advanced & Expert Users | 4 | 07-31-2006 08:23 PM |
| Compress and copy a Folder | scorpiyanz | UNIX for Advanced & Expert Users | 1 | 08-19-2005 01:53 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread |
Rating:
|
Display Modes |
|
|
|
||||
|
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. |
|
||||
|
Maybe this link will help:
Backup single large file |
|
||||
|
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 06:59 PM.. |
|
||||
|
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 !! |
|
||||
|
copy and compress without itermediate files
To compress:
Code:
tar cf - <space_separated_list_of_files/folders> | gzip -c - > <path>/<archive_name>.tar.gz cd to the directory you want the files extracted in and run: Code:
gunzip -c <path>/<archive_name>.tar.gz | tar xf - |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|