rar
Archives
Usage
rar a <archive.rar> <files> | unrar x <archive.rar>A proprietary format where only the extractor is free: creating an archive needs the paid rar binary, while `unrar x` — or `7z x` with nothing installed from RARLAB — unpacks one someone sent you, `x` keeping the stored paths and `e` flattening them, `-hp` hiding the file names too and `-v100m` splitting the archive into volumes.
Common flags
| Flag | Meaning |
|---|---|
| a | Add or create an archive (rar only). |
| x | Extract with full paths; e flattens them. Both work in unrar. |
| l | List the contents. |
| -p<password> | Encrypt the contents. Use -hp instead, not as well, to encrypt the file names too. |
| -m5 | Maximum compression. |
| -r | Recurse into subdirectories. |
| -v100m | Split into 100 MB volumes. |
Examples
unrar x archive.rarExtract a .rar someone sent you, keeping its folders.
7z x archive.rarExtracts without RARLAB tools; on many Linux distros this needs the non-free p7zip-rar codec.
rar a -m5 -r backup.rar ./dataCreate a .rar, which needs the paid rar binary.
Bundling and compressing are separate jobs: tar bundles, gzip shrinks, and .tar.gz is both.
How to read this
- Square brackets [ ] mark a part you may leave out.
- An ellipsis … means you can list more than one.
- Flags are case-sensitive — in some commands -r and -R do different things.
Questions
Q. What does rar do?
A proprietary format where only the extractor is free: creating an archive needs the paid rar binary, while `unrar x` — or `7z x` with nothing installed from RARLAB — unpacks one someone sent you, `x` keeping the stored paths and `e` flattening them, `-hp` hiding the file names too and `-v100m` splitting the archive into volumes.
Q. How do I type it?
rar a <archive.rar> <files> | unrar x <archive.rar> — square brackets mark the parts you can leave out.
Q. How many flags are worth knowing?
7 are listed here; the full set is in man rar. This command sits under Archives.
Related commands
man page: man rar