
7Z - build new zip - <Solved>
- Ed_P
- Contributor
- Posts: 8912
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
7Z - build new zip - <Solved>
How does one open 7Z to build a new zip file? 7Z works great for opening existing zip files and extracting a file or adding files to it but I'm trying to create a new one. 

-
- Full of knowledge
- Posts: 2104
- Joined: 17 Jun 2013, 13:17
- Distribution: Porteus 3.2.2 XFCE 32bit
- Location: Germany
7Z
gui or cli ?
gui > navigate to folder/file(s) to archive, select them and click the add button.
cli example:
gui > navigate to folder/file(s) to archive, select them and click the add button.
cli example:
Code: Select all
guest@porteus:~/The ultimate goth collection$ 7z a goth.7z ./*.mp4
Scanning the drive:
7 files, 29243861 bytes (28 MiB)
Creating archive: goth.7z
Items to compress: 7
Files read from disk: 7
Archive size: 29007383 bytes (28 MiB)
Everything is Ok
guest@porteus:~/The ultimate goth collection$
- Ed_P
- Contributor
- Posts: 8912
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
7Z
cli is fine to invoke the app and gui is preferred to select the files to be added to it. I don't want to compress a whole folder just a file or two from 1 and a file or two from a different one.
I created a file with zip on the end hoping it would open 7z and allow me to add files to it but 7z balked trying to open it.
-
- Full of knowledge
- Posts: 2104
- Joined: 17 Jun 2013, 13:17
- Distribution: Porteus 3.2.2 XFCE 32bit
- Location: Germany
7Z
I do not use the p7zip gui because most of the (menu) options do not work.
However, one can add files to an existing archive.(created with p7zip)
open the archive > navigate to the files you want to be added > select them and click 'add' >
At the top of the next window choose your zip archive > files are added.
this works as long as you haven't moved the archive to a different location.
if you did move the archive and want to add files:
open the archive > navigate to the files you want to add > select them > add --
BUT
in the next window click the [...] browse button > find your archive > select it,
click save > a pop-up 'this file does exist - overwriting?' > yes > back to
the previous window > OK -- new files added old ones still there.
btw.
this tool creates a lot of 7zCompress-xx-xx.tmp files and doesn't clean-up.
However, one can add files to an existing archive.(created with p7zip)
open the archive > navigate to the files you want to be added > select them and click 'add' >
At the top of the next window choose your zip archive > files are added.
this works as long as you haven't moved the archive to a different location.
if you did move the archive and want to add files:
open the archive > navigate to the files you want to add > select them > add --
BUT
in the next window click the [...] browse button > find your archive > select it,
click save > a pop-up 'this file does exist - overwriting?' > yes > back to
the previous window > OK -- new files added old ones still there.
btw.
this tool creates a lot of 7zCompress-xx-xx.tmp files and doesn't clean-up.
-
- Full of knowledge
- Posts: 2104
- Joined: 17 Jun 2013, 13:17
- Distribution: Porteus 3.2.2 XFCE 32bit
- Location: Germany
7Z
dummy file ?? ..why?
If you open the gui, navigate to files you want in an archive, select them,
click the 'add' button, in the next window select options/name, click OK and
a new archive is created.
(by default in the same folder where the selected files are.The p7zip gui does not
refresh to show it.You have to go (e.g) one folder up and back again to see
the new archive in the gui)
And as I said, you can add/delete files to/from this archive later if you want.
If you open the gui, navigate to files you want in an archive, select them,
click the 'add' button, in the next window select options/name, click OK and
a new archive is created.
(by default in the same folder where the selected files are.The p7zip gui does not
refresh to show it.You have to go (e.g) one folder up and back again to see
the new archive in the gui)
And as I said, you can add/delete files to/from this archive later if you want.
-
- Full of knowledge
- Posts: 2104
- Joined: 17 Jun 2013, 13:17
- Distribution: Porteus 3.2.2 XFCE 32bit
- Location: Germany
7Z
ooops....my bad....the P7ZIP File Manager has been stripped out.
but the example for cli usage should be valid.
and 7z -h for more options.
--> Archive Manager!!! That's what zips files! Okay. Good to find that out.<--
Yup, I was wondering why you didn't use it in the first place.

but the example for cli usage should be valid.
and 7z -h for more options.
--> Archive Manager!!! That's what zips files! Okay. Good to find that out.<--
Yup, I was wondering why you didn't use it in the first place.

- Ed_P
- Contributor
- Posts: 8912
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
7Z
7z -h shows a lot of options:
but no Create New File under <Commands>. But creating one is possible with the Archive Manager app. 
Code: Select all
guest@porteus:~$ 7z -h
7-Zip [64] 17.04 : Copyright (c) 1999-2021 Igor Pavlov : 2017-08-28
p7zip Version 17.04 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,64 bits,8 CPUs x64)
Usage: 7z <command> [<switches>...] <archive_name> [<file_names>...]
<Commands>
a : Add files to archive
b : Benchmark
d : Delete files from archive
e : Extract files from archive (without using directory names)
h : Calculate hash values for files
i : Show information about supported formats
l : List contents of archive
rn : Rename files in archive
t : Test integrity of archive
u : Update files to archive
x : eXtract files with full paths
<Switches>
-- : Stop switches parsing
@listfile : set path to listfile that contains file names
-ai[r[-|0]]{@listfile|!wildcard} : Include archives
-ax[r[-|0]]{@listfile|!wildcard} : eXclude archives
-ao{a|s|t|u} : set Overwrite mode
-an : disable archive_name field
-bb[0-3] : set output log level
-bd : disable progress indicator
-bs{o|e|p}{0|1|2} : set output stream for output/error/progress line
-bt : show execution time statistics
-i[r[-|0]]{@listfile|!wildcard} : Include filenames
-m{Parameters} : set compression Method
-mmt[N] : set number of CPU threads
-mx[N] : set compression level: -mx1 (fastest) ... -mx9 (ultra)
-o{Directory} : set Output directory
-p{Password} : set Password
-r[-|0] : Recurse subdirectories
-sa{a|e|s} : set Archive name mode
-scc{UTF-8|WIN|DOS} : set charset for for console input/output
-scs{UTF-8|UTF-16LE|UTF-16BE|WIN|DOS|{id}} : set charset for list files
-scrc[CRC32|CRC64|SHA1|SHA256|*] : set hash function for x, e, h commands
-sdel : delete files after compression
-seml[.] : send archive by email
-sfx[{name}] : Create SFX archive
-si[{name}] : read data from stdin
-slp : set Large Pages mode
-slt : show technical information for l (List) command
-snh : store hard links as links
-snl : store symbolic links as links
-sni : store NT security information
-sns[-] : store NTFS alternate streams
-so : write data to stdout
-spd : disable wildcard matching for file names
-spe : eliminate duplication of root folder for extract command
-spf : use fully qualified file paths
-ssc[-] : set sensitive case mode
-ssw : compress shared files
-stl : set archive timestamp from the most recently modified file
-stm{HexMask} : set CPU thread affinity mask (hexadecimal number)
-stx{Type} : exclude archive type
-t{Type} : Set type of archive
-u[-][p#][q#][r#][x#][y#][z#][!newArchiveName] : Update options
-v{Size}[b|k|m|g] : Create volumes
-w[{path}] : assign Work directory. Empty path means a temporary directory
-x[r[-|0]]{@listfile|!wildcard} : eXclude filenames
-y : assume Yes on all queries
guest@porteus:~$

-
- Full of knowledge
- Posts: 2104
- Joined: 17 Jun 2013, 13:17
- Distribution: Porteus 3.2.2 XFCE 32bit
- Location: Germany
7Z - <Solved>
Code: Select all
guest@porteus:~/Test$ 7z a test.zip 1.txt 2.txt 3.txt
- Ed_P
- Contributor
- Posts: 8912
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
7Z - <Solved>
donald wrote: ↑09 Nov 2022, 07:237z a create zip archive with name test.zip and files 1.txt 2.txt 3.txtCode: Select all
guest@porteus:~/Test$ 7z a test.zip 1.txt 2.txt 3.txt


- Rava
- Contributor
- Posts: 5424
- Joined: 11 Jan 2011, 02:46
- Distribution: XFCE 5.01 x86_64 + 4.0 i586
- Location: Forests of Germany
7Z new zip - <Solved>
it is indeed not that obvious how 7z -h phrases itdonald wrote: ↑09 Nov 2022, 07:237z a create zip archive with name test.zip and files 1.txt 2.txt 3.txtCode: Select all
guest@porteus:~/Test$ 7z a test.zip 1.txt 2.txt 3.txt
Code: Select all
<Commands>
a : Add files to archive
Archive Manager uses the CLI programs to do the actual work. More often than not the CLI programs themselves offer more options when using the terminal than what Archive Manager itself offers.
Still for most users what Archive Manager offers will suffice.
Cheers!
Yours Rava
Yours Rava
7Z new zip - <Solved>
Hi Ed
You can try the below 7z GUI module I created, since I found it useful.
Hope this helps you.
Missed to post it earlier.
https://www.mediafire.com/file/3ar98vyw ... i.xzm/file

You can try the below 7z GUI module I created, since I found it useful.
Hope this helps you.
Missed to post it earlier.
https://www.mediafire.com/file/3ar98vyw ... i.xzm/file

- Ed_P
- Contributor
- Posts: 8912
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
7Z new zip - <Solved>
Thank you Testuser.
I'm not in Porteus at the moment so I will have to try it later.
Your module is 6,084 KB and I found I have an old p7zip-16.02-x86_64_ncm.xzm module in my /optional folder that is 1,976 KB.

Your module is 6,084 KB and I found I have an old p7zip-16.02-x86_64_ncm.xzm module in my /optional folder that is 1,976 KB.
- Rava
- Contributor
- Posts: 5424
- Joined: 11 Jan 2011, 02:46
- Distribution: XFCE 5.01 x86_64 + 4.0 i586
- Location: Forests of Germany
7Z new zip - <Solved>
I also realized that for a mere GUI for 7z 5.94 MB is much on the heavy side…
Maybe they added much stuff that is not really necessary, or newer versions of 7zip morphed into bloatware. (I do hope that's not the case!)
Cheers!
Yours Rava
Yours Rava