Compression Tool
Published on: 22nd Apr 2014
Updated on: 30th Jan 2022
Why do we need a compression tool
There are many compression utilities in Ubuntu and tar
is the most commonly used utility. But, we want a utility program to password protect the compressed file before sending it to another server or let the user download the file.
Here's the component that you need
-
To install the program, execute the following command:
sudo apt-get install p7zip-full
-
To the compress the files
7z a myZipFile.7z @file-list.txt -xr!temp -pmyPassword
Where
myZipFile.7z
is the output name.file-list.txt
is a text file that contains the files and directories to be backed up. One file/directory per line.-xr!temp
is to exclude the 'temp' directory.-p
argument means password and 'myPassword' is the password to encrypt the file.
-
To test the archive (i.e., the compressed file), execute the following command:
7z t -pmyPassword myZipFile.7z
Related posts
Jump to #UBUNTU blog
Author
Lau Hon Wan, software developer.