The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 11:10 AM
Compress a file before ftp MrMac Shell Programming and Scripting 1 11-21-2006 09:06 AM
Compress while wrting to a file using a unix pipe booyena1 HP-UX 2 10-26-2005 12:52 AM
Compress in Unix Sasuke UNIX for Dummies Questions & Answers 1 10-10-2003 07:18 AM
Unix compress-Wintel uncompress rampart1 UNIX for Advanced & Expert Users 3 09-07-2003 04:33 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-22-2006
rujupriya rujupriya is offline
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
  #2 (permalink)  
Old 05-22-2006
madhunk madhunk is offline
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 
  #3 (permalink)  
Old 05-22-2006
reborg's Avatar
reborg reborg is offline Forum Staff  
Administrator
  
 

Join Date: Mar 2005
Location: Ireland
Posts: 4,206
you can literally type in

compress file

and

uncompress file
  #4 (permalink)  
Old 05-24-2006
thestevew thestevew is offline
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
  #5 (permalink)  
Old 05-24-2006
amro1 amro1 is offline
Registered User
  
 

Join Date: Mar 2006
Posts: 105
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.
  #6 (permalink)  
Old 05-24-2006
reborg's Avatar
reborg reborg is offline Forum Staff  
Administrator
  
 

Join Date: Mar 2005
Location: Ireland
Posts: 4,206
[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.
Sponsored Links
Closed Thread

Bookmarks

Tags
linux, linux commands

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 06:17 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0