LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Can tar accept an "include file" (as opposed to an include pattern)? (https://www.linuxquestions.org/questions/linux-newbie-8/can-tar-accept-an-include-file-as-opposed-to-an-include-pattern-4175447012/)

digitalformula 01-24-2013 05:49 AM

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:

~/Documents
~/Downloads

(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?

Thanks!

business_kid 01-24-2013 10:18 AM

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.


All times are GMT -5. The time now is 05:22 AM.