Command to remove existing files in the tar files in Solaris 10 | Unix Linux Forums | Solaris

  Go Back    


Solaris The Solaris Operating System, usually known simply as Solaris, is a Unix-based operating system introduced by Sun Microsystems. The Solaris OS is now owned by Oracle.

Command to remove existing files in the tar files in Solaris 10

Solaris


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 02-04-2013
muraliinfy04 muraliinfy04 is offline
Registered User
 
Join Date: Mar 2010
Last Activity: 9 September 2014, 2:27 AM EDT
Location: Chennai,India
Posts: 73
Thanks: 13
Thanked 0 Times in 0 Posts
Command to remove existing files in the tar files in Solaris 10

Hi,
I am using solaris 10 OS.Please help me out with the commands needed in below two scenarios.

1)How to delete the existing files in the tar file.

suppose i have a main tarfile named application.tar and it contains a file called ingres.tar .
what is the command to remove ingres.tar from the main application.tar file

2)What is the command to see specific files in the tar file.

suppose i have tar file named application.tar which contains solarisstudio.tar .i have used
Code:
tar -tvf tarfile name

.but my main tar file application.tar contains so many files.so i am not able to figure out whethere a specific file exists or not.

Appreciate your response on it.

---------- Post updated at 06:13 AM ---------- Previous update was at 05:11 AM ----------

Any response on the above mentioned query?

Last edited by Scrutinizer; 02-04-2013 at 05:21 AM.. Reason: removed icode tags added code tags and icode tags
Sponsored Links
    #2  
Old 02-04-2013
Scrutinizer's Avatar
Scrutinizer Scrutinizer is offline Forum Staff  
Moderator
 
Join Date: Nov 2008
Last Activity: 20 October 2014, 10:25 AM EDT
Location: Amsterdam
Posts: 9,533
Thanks: 284
Thanked 2,419 Times in 2,169 Posts
Try:
1. Normally it is not possible to delete a file from a tape archive. Some tars may have a special option. Otherwise the archive would need to be recreated.
2. Try:

Code:
tar tvf tarfile '*solarisstudio.tar'


Last edited by Scrutinizer; 02-04-2013 at 06:47 AM..
Sponsored Links
    #3  
Old 02-05-2013
MadeInGermany MadeInGermany is online now Forum Advisor  
Registered User
 
Join Date: May 2012
Last Activity: 20 October 2014, 1:56 PM EDT
Location: Simplicity
Posts: 1,966
Thanks: 126
Thanked 571 Times in 519 Posts
1) The pax command can do it.

Code:
man pax


Code:
pax -w -c "ingres.tar" < application.tar > newapplication.tar

newapplication.tar is the same as application.tar but the file ingres.tar
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Append files to a existing tar file. Nagaraja Akkiva Shell Programming and Scripting 4 07-21-2011 12:40 PM
tar command to explore multiple layers of tar and tar.gz files bashnewbee Shell Programming and Scripting 1 07-12-2011 05:08 PM
How to tar, compress and remove files older than two days edr Shell Programming and Scripting 4 04-22-2009 05:52 AM
how to add files to an existing tar file - HP-UNIX Nomaad UNIX for Dummies Questions & Answers 5 11-06-2008 04:27 AM
delete a file from an existing Solaris tar avnerht UNIX for Dummies Questions & Answers 2 03-20-2002 04:23 PM



All times are GMT -4. The time now is 01:56 PM.