Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 06-17-2014, 03:54 AM   #1
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.

Old 06-17-2014, 04:12 AM   #2
LQ Guru
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 8,781

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
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


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 04:45 AM
Excluding directories from tar? LocoMojo Linux - Software 6 01-24-2006 02:01 AM
excluding hidden directories when using tar djgerbavore Slackware 3 01-05-2006 04:49 PM
Find excluding multiple directories with a wildcard pteigeler Linux - Software 1 09-02-2005 11:57 AM
tar, excluding directories recursively towlie Linux - Newbie 3 06-17-2004 01:32 PM > Forums > Linux Forums > Linux - Newbie

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

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