Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 03-20-2006, 08:37 AM   #1
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:

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


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, 09:11 AM   #2
Senior Member
Registered: Jul 2004
Location: Lower Rhine region, Germany
Distribution: Slackware64 14.2 and current, SlackwareARM current
Posts: 1,602

Rep: Reputation: 126Reputation: 126
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.

( cd /dir1/webroot/website/project/compilers/myarchive; zip -r * )


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 01:06 PM
How to Unzip 2 Zip files through one single command sumitarun Linux - Newbie 2 03-23-2005 08:00 AM
use of zip command suchi_s Linux - General 18 05-28-2004 03:12 AM
Mounting a zip disk command. jtp51 Linux - General 4 02-19-2003 09:38 AM
Question about .zip lax2sman Linux - Software 1 02-17-2002 05:43 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:06 AM.

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