Forrest logo
back to the 7z tool

7z:tldr:eedf3

7z: [a]dd a file or directory to a new or existing archive.
$ 7z a ${path-to-archive-7z} ${filename_or_directory}
try on your machine

This command uses the 7-Zip software to create a compressed archive file. Here's a breakdown of the command:

  • "7z" refers to the 7-Zip program used for compression and extraction.
  • "a" is the action parameter that tells 7-Zip to create a new archive.
  • "${path-to-archive-7z}" is a placeholder that should be replaced with the desired path and name for the resulting archive file. It specifies where the archive will be saved, and the file extension ".7z" indicates it will be a 7-Zip archive.
  • "${filename_or_directory}" is another placeholder that should be replaced with the name of the file or directory you want to include in the archive. It specifies the content that will be compressed and added to the archive.

For example, if you wanted to create an archive called "backup.7z" containing the contents of a folder called "Documents", the command could look like this:

7z a C:\backup.7z C:\Documents

This would create a compressed archive file named "backup.7z" in the "C:\" directory, including the contents of the "Documents" folder.

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 7z tool