Menu

What is "-r" doing?

2006-07-21
2013-05-28
  • Alexander Skwar

    Alexander Skwar - 2006-07-21

    Hi!

    The 7z man page says:

           -r[-|0]
                  Recurse subdirectories (CAUTION: this flag does not do what you think, avoid using it)

    I just used "-r" and all my subdirectories got added just fine. I ran:

    7za a -r -t7z -m0=lzma -mx=9 -mfb=273 -md=28 -ms=on ../dir.7z .

    But I noticed, that I can leave away the -r, and nonetheless my subdirectories got added to the archive file.

    What is "-r" doing? Why is it bad to use -r?

    Thanks,
    Alexander

     
    • my space

      my space - 2006-07-21

      > What is "-r" doing? Why is it bad to use -r?

      7za a -r archive.7z "*.txt"
        walk though the current directory and all its sub-directories to add all files that match the filter "*.txt".

      7za a -r archive.7z dir
        walk though the current directory and all its sub-directories to add all files that match the filter "dir".
        so archive.7z will have all files or directories with name "dir".

      7za a archive.7z dir
        add the file "dir" or the directory "dir" with its sub-directories.

      7za a archive.7z .
      and
      7za a -r archive.7z .
      have the same behaviour.

       
    • Alexander Skwar

      Alexander Skwar - 2006-07-21

      Ah, that's a great explanation!

      It would be great, if this explanation could be added to the documentation. Would this be possible?

       

Log in to post a comment.