The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Unix Arithmatic operation issue , datatype issue thambi Shell Programming and Scripting 23 02-19-2008 07:19 AM
Q: tar archive help nookie UNIX for Dummies Questions & Answers 1 09-03-2007 10:30 AM
Archive (tar) dreams5617 UNIX for Dummies Questions & Answers 4 03-29-2007 08:13 AM
Archive files kayarsenal Shell Programming and Scripting 13 08-21-2006 11:01 AM
tar archive with .Z files Kun2112 UNIX for Dummies Questions & Answers 3 08-05-2005 09:42 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-11-2008
potro's Avatar
potro potro is offline
Registered User
  
 

Join Date: Mar 2008
Posts: 61
Tar archive issue

Hi,

I make a tar archive:
tar -czvf /path_to/cucu.tar.gz /path/dir_to_archive/

In the archive the /path/dir_to_archive/ is maintained for every file.

I need that the archive to be made without the /path/dir_to_archive/ to contain only the files in /path/dir_to_archive/.

Thanks,
Bianca
  #2 (permalink)  
Old 06-11-2008
Grippo Grippo is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 41
the answer is to cd to the directory that you are archiving and do tar up the relative locations:

tar cvf /x/file.tar ./*

now when you restore you will restore your archive relative to where you are unpacking the tar ball.
  #3 (permalink)  
Old 06-11-2008
potro's Avatar
potro potro is offline
Registered User
  
 

Join Date: Mar 2008
Posts: 61
Quote:
Originally Posted by Grippo View Post
the answer is to cd to the directory that you are archiving and do tar up the relative locations:

tar cvf /x/file.tar ./*

now when you restore you will restore your archive relative to where you are unpacking the tar ball.
I need to tar without changing directory. And I need tar ... with zip -j the problem would be solved.

Bianca

Last edited by potro; 06-11-2008 at 08:18 AM..
  #4 (permalink)  
Old 06-11-2008
Grippo Grippo is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 41
Quote:
Originally Posted by potro View Post
I need to tar without changing directory. And I need tar ... with zip -j the problem would be solved.

Bianca
why do you need to "tar without changing directory"?

looking back, I am not sure what the z flag is doing for you in the "tar czvf" - what flavor of UNIX are you using?
  #5 (permalink)  
Old 06-11-2008
potro's Avatar
potro potro is offline
Registered User
  
 

Join Date: Mar 2008
Posts: 61
Quote:
Originally Posted by Grippo View Post
why do you need to "tar without changing directory"?

looking back, I am not sure what the z flag is doing for you in the "tar czvf" - what flavor of UNIX are you using?
The archive command is included in a web page.
-z, --gzip, --ungzip
filter the archive through gzip
RH Linux

Bianca
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 04:41 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0