Unix/Linux Go Back    


UNIX for Dummies Questions & Answers This forum is closed for new posts. Please post beginner questions to learn unix and learn linux in this forum UNIX for Beginners Questions & Answers

Zip -r Functionality

UNIX for Dummies Questions & Answers


 
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 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 11:58 AM.. Reason: correcting the typo mistake
Sponsored Links
    #2  
Old Unix and Linux 10-30-2013
greet_sed greet_sed is offline
Registered User
 
Join Date: Aug 2011
Last Activity: 5 December 2016, 5:18 PM EST
Posts: 242
Thanks: 42
Thanked 78 Times in 74 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 12:12 PM.. Reason: add code tags
Sponsored Links
    #3  
Old Unix and Linux 10-30-2013
Corona688 Corona688 is offline Forum Staff  
Mead Rotor
 
Join Date: Aug 2005
Last Activity: 5 December 2016, 5:32 PM EST
Location: Saskatchewan
Posts: 21,658
Thanks: 1,008
Thanked 3,981 Times in 3,698 Posts
Instead of zip -r /incredibly/long/path/to/files ... try ( cd /incredibly/long ; zip -r path/to/files ... )
    #4  
Old Unix and Linux 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
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux 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 01:11 PM
Zip a file with .zip extension. aeroticman UNIX for Dummies Questions & Answers 1 08-04-2010 02:54 PM
ZIP multiple files and also specify size of zip file tom007 AIX 1 03-16-2010 03: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 04:19 PM
unzip .zip file and list the files included in the .zip archive oracledev UNIX for Dummies Questions & Answers 5 04-08-2008 05:49 PM



All times are GMT -4. The time now is 08:49 PM.