Download your favorite Linux distribution at LQ ISO.
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 01-24-2013, 05:49 AM   #1
LQ Newbie
Registered: Feb 2011
Posts: 12

Rep: Reputation: 0
Question Can tar accept an "include file" (as opposed to an include pattern)?

Hi all,

I know tar has the --include option and, on some systems, the --from-file= option. I'm using OS X, which doesn't have the --from-file option. I'm also aware of the -X option.

E.g. when using -X, I have /tmp/exclude.txt that contains the following:


(etc). Running tar on ~ with -X works perfectly as ~/Documents and ~/Downloads are excluded.

I'm looking for the inclusion equivalent of -X but can't seem to find anything in the man pages or GNU site. This is because I'd like to have a list of paths (not filenames) that are included in a tar command.

Does tar have that or do I need to create the include, manually cat/sed the contents and pass each path to the tar command?


Last edited by digitalformula; 01-24-2013 at 05:52 AM. Reason: Added additional info
Old 01-24-2013, 10:18 AM   #2
LQ Guru
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Pi OS & Android
Posts: 12,029

Rep: Reputation: 1416Reputation: 1416Reputation: 1416Reputation: 1416Reputation: 1416Reputation: 1416Reputation: 1416Reputation: 1416Reputation: 1416Reputation: 1416
Man tar never says much.
Grok the source, or use the info page. The tar info page sucks like few other things but it does have depth. You may have to spend some time searching.
Tar - Tar options - File options - less common options - really unusual options - never-heard-of options - macos intel - macos - qwerty etc.


include, tar

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
How to use "tar" to include./ on the path of the files jcbermu Linux - General 1 06-20-2007 08:20 AM
Bristol 10.4 configure not finding JACK,ALSA, or "X11 include file" on Ubuntu studio scwerllguy Linux - Software 7 06-03-2007 05:43 PM
Clarifiacation on header file "/usr/include/a.out.h" swathisat Linux - Software 0 09-05-2003 01:12 AM
sendmail: "permission denied" when using include:/file sohmc Linux - Software 1 05-22-2003 07:40 AM
What is correct code for "Include File Function" on .asp pages gregoryfrancis Linux - General 1 02-11-2003 11:49 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:45 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
Open Source Consulting | Domain Registration