LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-20-2006, 09:37 AM   #1
geekygirl74
LQ Newbie
 
Registered: Mar 2006
Distribution: RedHat 9, Mepis
Posts: 2

Rep: Reputation: 0
Question Question about the Zip command


Hi all,

I am using the Zip command in a project and have run into an issue I'm hoping someone can help me resolve. The problem is that the full path of the directory I'm zipping is ending up in the zip archive.

I'm trying to zip a directory with the following structure:
/dir1/webroot/website/project/compilers/myarchive

myarchive has three subfolders below its level

I need to preserve the subfolders of myarchive in order for my installation file to work, but need to get rid of the "dir1/webroot/website/project/compilers" directories that the Zip command is creating above myarchive.

My code is as follows:
-r /dir1/webroot/website/project/compilers/myarchive

/dir1/webroot/website/project/compilers/myarchive

I am invoking this code from our web server, everything is happening under the apache user so I am including the full path to the folder instead of cd'ing in to the correct path.

I've tried using the -j option, but that does not seem work. Is this possible using the apache user? Should I just create a folder in the root with these files and work with it there?

TIA for any tips and advice.
 
Old 03-20-2006, 10:11 AM   #2
titopoquito
Senior Member
 
Registered: Jul 2004
Location: Lower Rhine region, Germany
Distribution: Slackware 14.1 (32 and 64 bit)
Posts: 1,594

Rep: Reputation: 125Reputation: 125
Hm, what happens if you first change to the myarchive folder? I think zip stores the path relative to the actual folder, so cd'ing there should eliminate the other folders from the files' paths.

Code:
( cd /dir1/webroot/website/project/compilers/myarchive; zip -r myarchive-name.zip * )
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
replacing a file in a zip from command line davee Linux - General 3 02-28-2006 02:06 PM
How to Unzip 2 Zip files through one single command sumitarun Linux - Newbie 2 03-23-2005 09:00 AM
use of zip command suchi_s Linux - General 18 05-28-2004 04:12 AM
Mounting a zip disk command. jtp51 Linux - General 4 02-19-2003 10:38 AM
Question about .zip lax2sman Linux - Software 1 02-17-2002 06:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:34 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration