Zip -r Functionality | Unix Linux Forums | UNIX for Dummies Questions & Answers

  Go Back    


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 !!

Zip -r Functionality

UNIX for Dummies Questions & Answers


Reply    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 10-30-2013
smile689 smile689 is offline
Registered User
 
Join Date: Jun 2013
Last Activity: 28 January 2014, 5:59 AM EST
Posts: 59
Thanks: 38
Thanked 0 Times in 0 Posts
Zip -r Functionality

Hi ,

I've written the following code to zip the big file


Code:
$dir_temp ="/home/etc/hst
zip -r $dir_temp/file_nm.zip $dir_temp/file_nm

The zip file has been created . When I try to UNZIP the file
with the following command

Code:
unzip file_nm.zip

The file got unzipped but created in the following path /home/etc/hst/home/etc/hst/file_nm

Please suggest me the correct unzip command so that the file got unzipped in the /home/etc/hst folder .

Thanks

Last edited by smile689; 10-30-2013 at 10:58 AM.. Reason: correcting the typo mistake
Sponsored Links
    #2  
Old 10-30-2013
greet_sed greet_sed is offline
Registered User
 
Join Date: Aug 2011
Last Activity: 9 December 2013, 10:13 AM EST
Posts: 124
Thanks: 20
Thanked 33 Times in 32 Posts
How does your zip file look like ie structure ?

To unzip to another directory use:

Code:
unzip -d <DIR_NAME>


Code:
$dir_temp ="/home/etc/hst

is missing the double quotes at the end.
Make sure you add correct information here.

Last edited by greet_sed; 10-30-2013 at 11:12 AM.. Reason: add code tags
Sponsored Links
    #3  
Old 10-30-2013
Corona688 Corona688 is offline Forum Staff  
Mead Rotor
 
Join Date: Aug 2005
Last Activity: 15 April 2014, 5:23 PM EDT
Location: Saskatchewan
Posts: 18,516
Thanks: 680
Thanked 3,034 Times in 2,854 Posts
Instead of zip -r /incredibly/long/path/to/files ... try ( cd /incredibly/long ; zip -r path/to/files ... )
    #4  
Old 10-30-2013
smile689 smile689 is offline
Registered User
 
Join Date: Jun 2013
Last Activity: 28 January 2014, 5:59 AM EST
Posts: 59
Thanks: 38
Thanked 0 Times in 0 Posts
Thank You for your reply .

Is the following command works


Code:
unzip -d /home/etc/hst  file_nm.zip


Sorry for missing the double quotes

Thank You
Sponsored Links
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Zip Multiple files to One .zip file in AIX system RAMA PULI Shell Programming and Scripting 9 04-29-2013 12:11 PM
Zip a file with .zip extension. aeroticman UNIX for Dummies Questions & Answers 1 08-04-2010 01:54 PM
ZIP multiple files and also specify size of zip file tom007 AIX 1 03-16-2010 02:29 AM
Zip command (zip folder doesn't include a folder of the same name) elioncho UNIX for Dummies Questions & Answers 1 03-12-2009 03:19 PM
unzip .zip file and list the files included in the .zip archive oracledev UNIX for Dummies Questions & Answers 5 04-08-2008 04:49 PM



All times are GMT -4. The time now is 12:13 AM.