The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Help Required: Command to find IP address and command executed of a user loggedout Security 2 08-06-2008 05:12 PM
how to? launch command with string of command line options TinCanFury Shell Programming and Scripting 5 04-28-2008 03:06 PM
inconsistent ls command display at the command prompt & running as a cron job rajranibl Linux 5 07-30-2007 05:26 AM
How to use more than one MPE command STREAM with Unix command in a single shell? bosskr HP-UX 1 10-16-2006 01:16 PM
How to use more than one MPE command STREAM with Unix command in a single shell? bosskr Shell Programming and Scripting 0 09-19-2006 06:44 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 03-13-2007
Registered User
 

Join Date: Mar 2007
Posts: 5
Question Need help with tar command

Can anyone help me to staff three files with tar command and then unstaff them
Thx in advance for any help.
Reply With Quote
Forum Sponsor
  #2  
Old 03-13-2007
Registered User
 

Join Date: Feb 2005
Location: Broomfield, CO
Posts: 401
What's "staff" and "unstaff"?

Carl
Reply With Quote
  #3  
Old 03-13-2007
Registered User
 

Join Date: Jan 2007
Posts: 366
Quote:
Originally Posted by Geldy
Can anyone help me to staff three files with tar command and then unstaff them
Thx in advance for any help.

To create a tar archive:

tar cvf my_archive,tar /path/to/file1 /another/path/to/file2 /and/one/more/path/file3

The disadvantage of diong it this way is that all references to the files are by using an absolute path.

This means when you untar the archive the files will be stored to their original location (for the experts around, I know there are tricks to avoid this.)

So it's better to create an archive in which the references to the file have relative paths:

cd /
tar cvf my_archive,tar path/to/file1 another/path/to/file2 and/one/more/path/file3


To view the contents of your tar archive:

tar tvf my_archive

The untar the archive:

tar xvf my_archive

If the archive contains files with absolute path the files will be untarred to their original location.
If they have relative paths, the files will be untarred relative to the current directory.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 02:15 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0