The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


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
unix script to takes the old data from a TXT file and compress them into new file vpandey Shell Programming and Scripting 2 03-05-2008 08:10 AM
Compress a file before ftp MrMac Shell Programming and Scripting 1 11-21-2006 06:06 AM
Compress while wrting to a file using a unix pipe booyena1 HP-UX 2 10-25-2005 09:52 PM
Compress in Unix Sasuke UNIX for Dummies Questions & Answers 1 10-10-2003 04:18 AM
Unix compress-Wintel uncompress rampart1 UNIX for Advanced & Expert Users 3 09-07-2003 01:33 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 05-22-2006
Registered User
 

Join Date: May 2006
Posts: 5
compress a file in unix

Hi,
I want to compress a dmp file and ftp to another machine.pls tell me the steps to compress and uncompress the file in unix
Thankyou
Reply With Quote
Forum Sponsor
  #2  
Old 05-22-2006
Registered User
 

Join Date: Nov 2005
Posts: 91
This is the pseudo code for the question....The '$' signs are parameters passed to the script....

Make sure you check the path for your zip...

PHP Code:
/usr/local/pkware/pkzipc/pkzipc -add -path=none ${OUTPUTPATH}/${OUTPUTFILE} ${INPUTPATH}/${INPUTFILE
Once it is done, then FTP the zip file to the other server

PHP Code:
ftp -<< EOF
   verbose
   open 
${SERVER
   
$LOGON
   binary
   mput 
*.
   close
   bye
EOF 
Reply With Quote
  #3  
Old 05-22-2006
reborg's Avatar
Administrator
 

Join Date: Mar 2005
Location: Ireland
Posts: 3,644
you can literally type in

compress file

and

uncompress file
Reply With Quote
  #4  
Old 05-24-2006
Registered User
 

Join Date: Mar 2006
Location: South Yorkshire, UK
Posts: 114
A word of warning on the compress command - "compress afile.txt" will compress "afile.txt" and rename it "afile.txt.Z", the original afile will no longer exist. So, if you need access to the original after compression, make a copy first!
The uncompress command (or compress -d) works whether you specify afile.txt or afile.txt.Z
Reply With Quote
  #5  
Old 05-24-2006
Registered User
 

Join Date: Mar 2006
Posts: 106
Here..

There are many compressing commands in UNIX/Linux: zip/unzip,gzip/gunzip,compress/uncompress,pax and so on...
Even tar command now knows to compress, for example
like tar -cvzf myarchive.tar.Z /somedirectory so there is no need to perform
compression as it does it automatically with "z" option added.

Hope it helps.

Get "UNIX in 24 hours" book or "UNIX Essentials and UNIX Core" DVD as they explain stuff like that.
Reply With Quote
  #6  
Old 05-24-2006
reborg's Avatar
Administrator
 

Join Date: Mar 2005
Location: Ireland
Posts: 3,644
[quote=amro1]Even tar command now knows to compress, for example
like tar -cvzf myarchive.tar.Z /somedirectory so there is no need to perform
compression as it does it automatically with "z" option added.
QUOTE]

This is not a standard behaviour in most UNIX systems. It is an extended feature of GNU tar, which may or may not be available.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Tags
linux

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 02:47 AM.


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

Content Relevant URLs by vBSEO 3.2.0