LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-17-2014, 02:54 AM   #1
charlemagne-is-my-son
Member
 
Registered: Dec 2012
Location: Shanghai
Distribution: Xubuntu, 14.04
Posts: 54

Rep: Reputation: Disabled
excluding multiple directories from a tar


how can I tell tar to exclude more than a single target with the --exclude= argument? For example, excluding two of five directories in a parent directory.

Thanks
 
Old 06-17-2014, 03:12 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 7,921

Rep: Reputation: 776Reputation: 776Reputation: 776Reputation: 776Reputation: 776Reputation: 776Reputation: 776
I would prefer to dream up a filename that describes the ones I want. You can use a couple of tar invocations (add to archive in 2nd & subsequent). To exclude 2, I would use

--exclude dir1 --exclude dir2
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Excluding multiple directories flamingo_l Linux - Newbie 11 08-03-2010 03:45 AM
Excluding directories from tar? LocoMojo Linux - Software 6 01-24-2006 01:01 AM
excluding hidden directories when using tar djgerbavore Slackware 3 01-05-2006 03:49 PM
Find excluding multiple directories with a wildcard pteigeler Linux - Software 1 09-02-2005 10:57 AM
tar, excluding directories recursively towlie Linux - Newbie 3 06-17-2004 12:32 PM


All times are GMT -5. The time now is 11:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration