Display RAR Archive Comments Using unrar
This article explains how to view the embedded comment of a RAR
archive from the command line using the unrar utility. You
will learn the exact command syntax, how to handle password-protected
archives, and how to suppress unnecessary output to view only the
comment text.
The Command to Show Archive Comments
The dedicated command to display an archive comment in
unrar is the c command.
unrar c archive.rarReplace archive.rar with the path to your target RAR
file. When executed, unrar reads the metadata of the
specified archive and prints the stored comment directly to the terminal
standard output.
Syntax and Options
The basic syntax for the command is:
unrar c [switches] <archive-name>Viewing Comments in Password-Protected Archives
If the archive or its header is encrypted with a password, you can
supply the password directly using the -p switch:
unrar c -pSecretPassword archive.rarNote: Do not leave a space between -p and your
password.
Suppressing Banner Output
By default, unrar prints software version and copyright
information before displaying the comment. To suppress this header and
display a cleaner output, use the -idq (quiet mode) or
-inul (disable messages) switch:
unrar c -idq archive.rarThis is particularly useful when scripting or piping the archive comment into other command-line tools.