看板FreeBSD
标 题Re: 使用tar的问题!
发信站SayYA 资讯站 (Mon Jan 16 17:07:18 2006)
转信站ptt!ctu-reader!news.nctu!SayYa
※ 引述《[email protected] (悸动)》之铭言:
> ※ 引述《[email protected] (Angou)》之铭言:
> > 各位先进,请问:
> > 使用tar时可否做到下列动作?
> > 当tar档已存在的情形下:
> > 1. 只解出其中部分档案。
> (for bsdtar) 看 --include 这个指令。
--include pattern (-W include=pattern)
Process only files or directories that match the specified pat-
tern. Note that exclusions specified with --exclude take prece-
dence over inclusions. If no inclusions are explicitly speci-
fied, all entries are processed by default. The --include option
is especially useful when filtering archives. For example, the
command
tar -c -f new.tar --include='*foo*' @old.tgz
creates a new archive new.tar containing only the entries from
old.tgz containing the string `foo'.
> > 2. 另外压入其他档案。
> 本来用 -c,改用 -r 或 -u。
-r Like -c, but new entries are appended to the archive. Note that
this only works on uncompressed archives stored in regular files.
The -f option is required.
--
*****************************************************
* 疯狂小恶魔分享讨论区 *
*
http://www.freestudio.twbbs.org/index.php *
* 无名相簿-appleboy *
*
http://www.wretch.cc/album/appleboy *
*****************************************************
--
※ Origin: SayYA 资讯站 <bbs.sayya.org>
◆ From: freebsd.ee.ccu.edu.tw