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
exclude a line big123456 Shell Programming and Scripting 3 04-24-2008 09:31 AM
How to exclude top level directory with find? siegfried Shell Programming and Scripting 3 09-18-2007 08:15 PM
how do i exclude the current directory when using find? mjays Shell Programming and Scripting 7 04-24-2007 05:13 AM
Exclude & Zip dreams5617 Shell Programming and Scripting 1 02-11-2007 04:01 PM
Exclude a directory to tar ust UNIX for Dummies Questions & Answers 1 10-12-2005 01:35 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-08-2006
Registered User
 

Join Date: Mar 2005
Posts: 12
Tar directory but exclude other

OS: SunOS perfs01 5.8 Generic_117350-23 sun4u sparc SUNW,UltraAX-i2

I want to tar a directory, but there are subdirectoires I want to exclude. Does anyone know how to do it?

Please help.

thanks.
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 05-09-2006
Registered User
 

Join Date: Mar 2006
Location: South Yorkshire, UK
Posts: 114
You could use the "-L InputList" argument and provide the list of directories (and/or files) to include in a file ('man tar' for more info). If you can generate the list of directories easily then this works well.
This option needs care tho as (for obvious reasons) tar doesn't descend recursively through directories in an InputList, so each directory needs to be specifically included - this is probably what you want so that you can, say, tar a directory and some, but not all, of its children.

hope this helps

cheers
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 07:22 AM.


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

Content Relevant URLs by vBSEO 3.2.0