X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;ds=sidebyside;f=doc%2Ftar.texi;h=1bbb5b7a09a97498d70200a486fefda029257d34;hb=e2dbba2f07a403fbdda06efea93b79be910a1402;hp=221d128c923b194e77445cdccc32653129f9be40;hpb=0fc3177ed24623ca4204fa54f901ef6a182cc8b8;p=chaz%2Ftar diff --git a/doc/tar.texi b/doc/tar.texi index 221d128..1bbb5b7 100644 --- a/doc/tar.texi +++ b/doc/tar.texi @@ -6990,26 +6990,26 @@ Here are several examples of @option{--transform} usage: @item Extract @file{usr/} hierarchy into @file{usr/local/}: @smallexample -$ @kbd{tar --transform='s,usr/,usr/local/,' -x arch.tar} +$ @kbd{tar --transform='s,usr/,usr/local/,' -x -f arch.tar} @end smallexample @item Strip two leading directory components (equivalent to @option{--strip-components=2}): @smallexample -$ @kbd{tar --transform='s,/*[^/]*/[^/]*/,,' -x arch.tar} +$ @kbd{tar --transform='s,/*[^/]*/[^/]*/,,' -x -f arch.tar} @end smallexample @item Prepend @file{/prefix/} to each file name: @smallexample -$ @kbd{tar --transform 's,^,/prefix/,' -x arch.tar} +$ @kbd{tar --transform 's,^,/prefix/,' -x -f arch.tar} @end smallexample @item Convert each file name to lower case: @smallexample -$ @kbd{tar --transform 's/.*/\L&/' -x arch.tar} +$ @kbd{tar --transform 's/.*/\L&/' -x -f arch.tar} @end smallexample @end enumerate @@ -7030,6 +7030,10 @@ To test @option{--transform} effect we suggest to use $ @kbd{tar -cf arch.tar --transform='s,^usr/,var/,' \ --verbose --show-transformed-names /} @end smallexample + +If both @option{--strip-components} and @option{--transform} are used +together, then @option{--transform} is applied first, and the required +number of components is then stripped from its result. @node after @section Operating Only on New Files