Go Back   The UNIX and Linux Forums > Operating Systems > Solaris


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.

Reply    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 02-04-2013
Registered User
 
Join Date: Mar 2010
Location: Chennai,India
Posts: 64
Thanks: 10
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
Moderator
 
Join Date: Nov 2008
Location: Amsterdam
Posts: 7,352
Thanks: 144
Thanked 1,756 Times in 1,593 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
Registered User
 
Join Date: May 2012
Posts: 544
Thanks: 30
Thanked 139 Times in 129 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
Reply

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 02:34 PM.