macoscommand-line-interfacerar

How to exclude .DS_Store when creating rar file on macOS?


According to the manpage of rar

rar a -r -x.DS_Store "rar file name" "folder"

should exclude .DS_Store from being packed into rar file. But it does not work.

I also tried:

rar a -r -x".DS_Store" "rar file name" "folder"
rar a -r -x"*/.DS_Store" "rar file name" "folder"
rar a -r -x"*.DS_Store" "rar file name" "folder"

None of them works.


Solution

  • OK, I got it.

    rar a -r -x'*/.DS_Store' "rar file name" "folder"
    

    will do the trick.