Forrest logo
back to the 7za tool

7za:tldr:e5c47

7za: Encrypt an existing archive (including file names).
$ 7za a ${path-to-encrypted-7z} -p${password} -mhe=${on} ${path-to-archive-7z}
try on your machine

This command is using the 7za utility to create an encrypted 7z archive file. Let's break it down:

  • 7za: This is the command for the 7-Zip command-line utility.
  • a: This is a flag for the "add" operation, indicating that we want to create an archive.
  • ${path-to-encrypted-7z}: This is the path and filename for the new encrypted 7z archive file. You should replace ${path-to-encrypted-7z} with the desired path and filename of the encrypted archive.
  • -p${password}: This is a flag for specifying the password for the encrypted archive. You should replace ${password} with the desired password.
  • -mhe=${on}: This is a flag to enable the "header encryption" feature. ${on} is a variable that should be replaced with a value like on or true to enable this feature.
  • ${path-to-archive-7z}: This is the path and filename of the source files or directory that you want to compress and add to the 7z archive. You should replace ${path-to-archive-7z} with the desired source files or directory.

Overall, this command will create an encrypted 7z archive file with the specified password, enabling header encryption and including the files/directory specified in ${path-to-archive-7z}.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the 7za tool