Accourding documentation ( 
http://www.gnu.org/software/tar/manual/html_section/recurse.html ):

$ tar -cf jams.tar --no-recursion grape --recursion grape/concord
creates an archive with one entry for ‘grape’, and the recursive contents of 
‘grape/concord’, but no entries under ‘grape’ other than ‘grape/concord’.

My test with directory grape contains subdir "concord", "aa", "zz":

# tar -cf jams.tar --no-recursion grape --recursion grape/concord && tar --list 
-f jams.tar 
grape/
grape/zz/
grape/zz/11/
grape/bb
grape/concord/
grape/concord/aa
grape/concord/
grape/concord/aa

Looks like --no-recursion and --recursion just negate each other.

More examples: two dirs "aa" and "bb" with file "11" and subdir "zz" in each.
# tar -cf test.tar --no-recursion aa --recursion bb && tar --list -f test.tar 
aa/
aa/zz/
aa/11
bb/
bb/zz/
bb/11

Switching options order:

# tar -cf test.tar --recursion aa --no-recursion bb && tar --list -f test.tar 
aa/
bb/

Is it bug or I shouldn't use --no-recursion and --recursion at same time?

Reply via email to