#Terminal zip folder how to
However, you can learn more about how to use Tar to create archives, execute the –help command below. We’ve just scratched the surface of what you can do to compress files. Suffice it to say the Tar command is incredibly versatile. Tar -czvf /home/username/path/to/file/or/folder/ The command below will compress absolutely everything in the “Documents” folder.ĭon’t want to compress everything in a folder? Only want to compress a specific thing? Try this command instead. Once the terminal is in the “Documents” directory, you create a new TarGZ archive. In this example, we will be using the “Documents” directory. To compress a file (or multiple files), execute the following command example.įirst, move into the folder that has the files you wish to compress. From there, make use of the tar command example below to learn how to compress files and folders. To compress files in a TarGZ archive, open up a terminal window by pressing Ctrl + Alt + T or Ctrl + Shift + T on the keyboard. However, the most versatile and useful archives you can make with Tar is TarGZ.
The Tar command can create archives in many different formats, such as TGZ, Tar, XZ, and others. Tar is a built-in utility that a lot of Linux programs rely on, so there is no need to go over how to install it. The number one way to compress files in the terminal on the Linux platform is with Tar. Are you new to Linux? Want to learn how to compress files from the Linux terminal but don’t know how to do it? We can help! Follow along as we go over 4 ways to compress files in the terminal on Linux!