Some of you have probably noticed that Linux doesn't overwrite an old archive with a new one but it actually merges both files. But, depending on the contents of both files, the result might look like an overwritten file. If the directory and file structure and names inside both archives is the same, you won't see the difference. But if you have an archive like mine which changes often (CLI-SCRIPTS-AND-ALIASES.7z) and you attemt to replace the old archive with the new one, that's when you'll see and feel the difference which results in nothing short of a mess inside the archive - duplicating files and directories with different content and then you have to waste time to figure out which is the latest and which you have to delete.
One way to avoid this merging is to delete the old file first. But there's an easier way - one that will work just like on Windows where the old file is being completely overwritten by the new file. And the reason for that will be because linux can't see what's inside the two archives. When that happens, by default linux replaces the old archive with the new one.
1. GUI version.
Right click on the files/dirs you wanna archive, click "Compress", input a filename. Then click the checkbox which should read something along the line of "encrypt the files in the archive". Then enter whatever password you want. It doesn't have to be anything complex, even the digit "1" is enough for the encryption to work.
The result of that encryption when you open the archive is that you'll be met with a small dialog to enter the password. If you enter the wrong password or don't enter one at all, you'll only see the empty window of the archive manager you're using - no files, no anything.
The same way you can't see what's inside that archive, Linux can't see it as well. As a result, as I already mentioned, if you copy-paste the new archive on top of the already existing one, Linux will overwrite the archive, it won't merge both into one.
2. CLI version.
cd to whatever you wanna archive. In this example I'll use my directory with playlists.
7z a - tells p7zip (or 7zip) to create an archive.
-p tells it to use a pasword. And yes, the password must be adhered to the character "p". Otherwise (depending on the p7zip version) you'll have a password " 1" (space1), or p7zip won't accept the password, or will simply skip the creation of one and move on to the next parts of the command.
-mhe - enable file encryption. It can also be used as "-mhe=on", both variants work.
-----------------------------------------
These three flags above are the mandatory. The next two are optional:
-----------------------------------------
-mx (by default -mx and mx=9 are one and the same which means "maximum compression". The number vary from 0 to 9 where 0 means no compression. If you don't include the -mx flag, by default will use standard ("normal") compression, which I think equals 5.
-mmt=20 tells p7zip how many threads to use.
I know it looks like a lot of information and hard but really it is not. If you do it just once or twice, you'll see how easy it is.
The CLI version can be used as an alias which makes it even easier and 5-6 times faster than the GUI verison.
One way to avoid this merging is to delete the old file first. But there's an easier way - one that will work just like on Windows where the old file is being completely overwritten by the new file. And the reason for that will be because linux can't see what's inside the two archives. When that happens, by default linux replaces the old archive with the new one.
1. GUI version.
Right click on the files/dirs you wanna archive, click "Compress", input a filename. Then click the checkbox which should read something along the line of "encrypt the files in the archive". Then enter whatever password you want. It doesn't have to be anything complex, even the digit "1" is enough for the encryption to work.
The result of that encryption when you open the archive is that you'll be met with a small dialog to enter the password. If you enter the wrong password or don't enter one at all, you'll only see the empty window of the archive manager you're using - no files, no anything.
The same way you can't see what's inside that archive, Linux can't see it as well. As a result, as I already mentioned, if you copy-paste the new archive on top of the already existing one, Linux will overwrite the archive, it won't merge both into one.
2. CLI version.
cd to whatever you wanna archive. In this example I'll use my directory with playlists.
Code:
7z a -p1 -mhe -mx -mmt=20 PLAYLISTS.7z PLAYLISTS
-p tells it to use a pasword. And yes, the password must be adhered to the character "p". Otherwise (depending on the p7zip version) you'll have a password " 1" (space1), or p7zip won't accept the password, or will simply skip the creation of one and move on to the next parts of the command.
-mhe - enable file encryption. It can also be used as "-mhe=on", both variants work.
-----------------------------------------
These three flags above are the mandatory. The next two are optional:
-----------------------------------------
-mx (by default -mx and mx=9 are one and the same which means "maximum compression". The number vary from 0 to 9 where 0 means no compression. If you don't include the -mx flag, by default will use standard ("normal") compression, which I think equals 5.
-mmt=20 tells p7zip how many threads to use.
I know it looks like a lot of information and hard but really it is not. If you do it just once or twice, you'll see how easy it is.
The CLI version can be used as an alias which makes it even easier and 5-6 times faster than the GUI verison.

