LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 09-12-2010, 12:53 PM   #1
SirLouen
LQ Newbie
 
Registered: Aug 2010
Posts: 12

Rep: Reputation: 0
Linux zip, excluding whole directory path


I'm trying to compress with zip for linux utility a file

Is need to be done (example):

zip /usr/src/source.zip /usr/src/source.file

But I would like that in the zip file there is only one file: source.file instead the whole directory path /usr, /src,... and the file.

I can't move up to the directory /usr/src/ to execute the command.

I must do this from / directory.

If this possible? I Windows systems even if I do the zip C:\directory1\directory2\source.zip C:\directory1\directory2\source.file, it does what I need: a Zip in directory2 with just the file source.file.

Any ideas? I've been looking up the man page for zip, but did not find anything useful, tried, -j, -D with no success.

Regards
 
Old 09-12-2010, 03:40 PM   #2
SirLouen
LQ Newbie
 
Registered: Aug 2010
Posts: 12

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by SirLouen View Post
I'm trying to compress with zip for linux utility a file

Is need to be done (example):

zip /usr/src/source.zip /usr/src/source.file

But I would like that in the zip file there is only one file: source.file instead the whole directory path /usr, /src,... and the file.

I can't move up to the directory /usr/src/ to execute the command.

I must do this from / directory.

If this possible? I Windows systems even if I do the zip C:\directory1\directory2\source.zip C:\directory1\directory2\source.file, it does what I need: a Zip in directory2 with just the file source.file.

Any ideas? I've been looking up the man page for zip, but did not find anything useful, tried, -j, -D with no success.

Regards
I don't know what I was doing, but with -j worked me now...

Anyway thanks
 
  


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
Excluding executables in a sub-directory from tar backups sorvad Linux - General 5 07-29-2010 06:04 AM
Mod Rewrite: Excluding a specific path from rules. nutnut Linux - Software 1 10-13-2006 04:59 AM
Excluding a directory when copying Woodsman Slackware 2 10-30-2005 06:25 PM
Excluding directories from zip files jonathanztaub Linux - General 1 05-17-2004 02:17 AM
The utility zip is not in your path LinuxScott Linux - General 7 05-05-2003 04:55 PM


All times are GMT -5. The time now is 03:23 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration