tar exclude

when use tar to collect a dir, if you want to omit some dir(s) or file(s),
you can choose --exclude, as descibled in "man tar" :

"
--exclude=FILE
exclude file FILE

-X, --exclude-from=FILE
exclude files listed in FILE


"
so what is the difference between --exclude and --exclude-from ?

--exclude=ACTUAL_FILE and --exclude-from=ACTUAL_DIR ?


when tried many times, the following was I did successfully at last,

tar --exclude=./log/* --exclude=./mobilemid* -czvf aa.tar.gz ./*


sounds strange..



--
Wadelau [at] UFQI.com
Wade Lau [ Do, 24 Januar 2008 05:10 ] [ ID #1915032 ]

Re: tar exclude

In article <fn933u$g5h$1 [at] news.yaako.com>,
"Wade Lau" <wadelau [at] gmail.com> wrote:

> when use tar to collect a dir, if you want to omit some dir(s) or file(s),
> you can choose --exclude, as descibled in "man tar" :
>
> "
> --exclude=FILE
> exclude file FILE
>
> -X, --exclude-from=FILE
> exclude files listed in FILE
>
>
> "
> so what is the difference between --exclude and --exclude-from ?
>
> --exclude=ACTUAL_FILE and --exclude-from=ACTUAL_DIR ?

No. --exclude-from=FILE_THAT_CONTAINS_FILENAMES

>
>
> when tried many times, the following was I did successfully at last,
>
> tar --exclude=./log/* --exclude=./mobilemid* -czvf aa.tar.gz ./*
>
>
> sounds strange..

--
Barry Margolin, barmar [at] alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
Barry Margolin [ Do, 24 Januar 2008 05:31 ] [ ID #1915034 ]
Linux » comp.unix.shell » tar exclude

Vorheriges Thema: Re: Arrays doubts in KSH
Nächstes Thema: internal alias