7Zip: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
No edit summary
 
(22 intermediate revisions by the same user not shown)
Line 1: Line 1:
sudo apt -qq update
{|class='wikitable' style='width:100%;margin:-11px 0 6px 0'
sudo apt install -y p7zip-full
|valign='top' style='width:50%'|
7z
<syntaxhighlight style='margin:3px 0' lang='bash'>
sudo apt -qq update
sudo apt install -y p7zip-full
7z
</syntaxhighlight>
 
|valign='top' style='width:50%'|
|}


==Compress==
==Compress==
<syntaxhighlight lang="bash">
{|class='wikitable mw-collapsible' style='width:100%;margin:3px 0'
!scope='col' style='text-align:left'|
Compress
|-
|valign='top'|
<syntaxhighlight style='margin:3px 0' lang='bash'>
cd /etc/nginx
cd /etc/nginx
7z a chorke-nginx_academia-production-20240628-T2023-ZP0800.7z sites-enabled
7z a chorke-nginx-academia.prod.2024-06-28T2023.7z sites-enabled
7z a chorke-nginx_academia-production-20240628-T2023-ZP0800.7z sites-enabled '-psadaqah!'
7z a chorke-nginx-academia.prod.2024-06-28T2023.7z sites-enabled -psadaqah!
7z a chorke-nginx_academia-production-20240628-T2023-ZP0800.7z sites-enabled '-x!default'
7z a chorke-nginx-academia.prod.2024-06-28T2023.7z sites-enabled '-psadaqah!'
7z a chorke-nginx_academia-production-20240628-T2023-ZP0800.7z sites-enabled '-xr!default'
7z a chorke-nginx-academia.prod.2024-06-28T2023.7z sites-enabled '-x!default'
7z a chorke-nginx-academia.prod.2024-06-28T2023.7z sites-enabled '-xr!default'
</syntaxhighlight>
</syntaxhighlight>
|}


==Decompress==
==Decompress==
<syntaxhighlight lang="bash">
{|class='wikitable mw-collapsible' style='width:100%;margin:3px 0'
7z l chorke-nginx_academia-production-20240628-T2023-ZP0800.7z
!scope='col' style='text-align:left'|
7z e chorke-nginx_academia-production-20240628-T2023-ZP0800.7z
Decompress
7z x chorke-nginx_academia-production-20240628-T2023-ZP0800.7z
|-
7z x chorke-nginx_academia-production-20240628-T2023-ZP0800.7z '-psadaqah!'
|valign='top'|
7z x chorke-nginx_academia-production-20240628-T2023-ZP0800.7z -o./chorke-nginx-academia-production/
<syntaxhighlight style='margin:3px 0' lang='bash'>
7z l chorke-nginx-academia.prod.2024-06-28T2023.7z
7z e chorke-nginx-academia.prod.2024-06-28T2023.7z
7z x chorke-nginx-academia.prod.2024-06-28T2023.7z
7z x chorke-nginx-academia.prod.2024-06-28T2023.7z -psadaqah!
7z x chorke-nginx-academia.prod.2024-06-28T2023.7z '-psadaqah!'
7z x chorke-nginx-academia.prod.2024-06-28T2023.7z -o./chorke-nginx-academia-production/
</syntaxhighlight>
</syntaxhighlight>
|}


==Commands==
==Commands==
  a : Add files to archive
{|class='wikitable mw-collapsible' style='width:100%;margin:3px 0'
  b : Benchmark
!scope='col' style='text-align:left' colspan='2'|
  d : Delete files from archive
Commands
  e : Extract files from archive (without using directory names)
|-
  h : Calculate hash values for files
|valign='top' style='width:50%'|
  i : Show information about supported formats
<syntaxhighlight style='margin:3px 0' lang='text'>
  l : List contents of archive
a : Add files to archive
  rn : Rename files in archive
b : Benchmark
  t : Test integrity of archive
d : Delete files from archive
  u : Update files to archive
e : Extract files from archive (without using directory names)
  x : eXtract files with full paths
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
</syntaxhighlight>
 
|valign='top' style='width:50%'|
|}
 
==Cheatsheet==
{|class='wikitable mw-collapsible' style='width:100%;margin:3px 0'
!scope='col' style='text-align:left' colspan='5'|
Cheatsheet
|-
!scope="col"| Type !!scope="col"|                                                                Compress !!scope="col"|                                                                  Decompress !!scope="col"|                    Algorithm !!scope="col"| ⚪
|-
| '''7z'''        || <code>time 7z a nginx.2024-06-30T1519.7z &nbsp;nginx</code>                          || <code>time 7z x nginx.2024-06-30T1519.7z</code>                                          || LZMA, LZMA2, PPMd, BZIP2, DEFLATE, Store || 🟠
|-
| '''zip'''        || <code>time 7z a nginx.2024-06-30T1519.zip nginx</code>                              || <code>time 7z x nginx.2024-06-30T1519.zip</code>                                          || DEFLATE, BZIP2, LZMA, Store              || 🟢
|-
| '''tar.gz'''    || <code>time tar cf - nginx&#124;7z a -si nginx.2024-06-30T1519.tar.gz</code>          || <code>time 7z x nginx.2024-06-30T1519.tar.gz &nbsp;-so&#124;7z x -si -ttar -onginx</code> || DEFLATE=LZ77+Huffman                    || 🟢
|-
| '''tar.xz'''    || <code>time tar cf - nginx&#124;7z a -si nginx.2024-06-30T1519.tar.xz -txz</code>    || <code>time 7z x nginx.2024-06-30T1519.tar.xz &nbsp;-so&#124;7z x -si -ttar -onginx</code> || LZMA2                                    || 🟠
|-
| '''tar.bz2'''    || <code>time tar cf - nginx&#124;7z a -si nginx.2024-06-30T1519.tar.bz2 -tbzip2</code> || <code>time 7z x nginx.2024-06-30T1519.tar.bz2 -so&#124;7z x -si -ttar -onginx</code>      || BZIP2                                    || 🟡
|}


==DateTime Format==
==DateTime Format==
<syntaxhighlight lang="bash">
{|class='wikitable mw-collapsible' style='width:100%;margin:3px 0'
echo "$(date +'%Y%m%d-T%H%M')-Z$(date +'%z'|tr '+-' 'PM')"
!scope='col' style='text-align:left' colspan='2'|
DateTime Format
|-
|valign='top' style='width:50%'|
<syntaxhighlight style='margin:3px 0' lang='bash'>
echo     "$(TZ=UTC-8 date +'%Y-%m-%dT%H%M')"
echo            "$(TZ=UTC-8 date +'%FT%H%M')"
BKP_DATE_N_TIME="$(TZ=UTC-8 date +'%FT%H%M')"
:'
:'
20240628-T2023-ZP0800
2025-10-10T1010
├─ 20240628
├─ 2025-10-21
│  ├─ 2024 « %Y
│  ├─ 2025 « %Y
│  ├─ 06   « m%
│  ├─  10 « %m
│  └─ 28   « %d
│  └─  10 « %d
├─ -T2023
└─ T1010
│  ├─ -   « -
  ├─    T « Time
│  ├─ T   « Time
  ├─  10 « %H
│  ├─ 20   « %H
  └─  10 « %M
│  └─ 23   « %M
└─ -ZP0800
  ├─ -    « -
  ├─ Z    « Zone
  ├─ P    « {P: Plus (+), M:Minus (-)}
  └─ 0800 « Time Offset
'
'
</syntaxhighlight>
</syntaxhighlight>
|valign='top' style='width:50%'|
|}


==References==
==References==
{|
{|class='wikitable mw-collapsible' style='width:100%;margin:3px 0'
| valign="top" |
!scope='col' style='text-align:left' colspan='3'|
References
|-
|valign='top' style='width:33%'|
* [https://superuser.com/questions/1095406/ 7Zip » Extract By Password]
* [https://askubuntu.com/questions/645545/ 7Zip » Exclude File Types]
* [https://askubuntu.com/questions/645545/ 7Zip » Exclude File Types]
* [https://operavps.com/docs/install-7zip-in-linux/ 7Zip » Install]
* [https://operavps.com/docs/install-7zip-in-linux/ 7Zip » Install]
Line 64: Line 120:
* [[Zip]]
* [[Zip]]
* [[Tar]]
* [[Tar]]
* [[Jar]]


| valign="top" |
|valign='top' style='width:34%'|
 
| valign="top" |


|valign='top' style='width:33%'|
|-
|-
| colspan="3" |
|valign='top'|
----
|-
| valign="top" |
* [[Minikube Systemd]]
* [[Minikube Systemd]]
* [[Alpine/Morefine]]
* [[Alpine/Morefine]]
Line 85: Line 138:
* [[TMux]]
* [[TMux]]


| valign="top" |
|valign='top'|
* [[Chorke Academia Backup]]
* [https://stackoverflow.com/questions/10555483/ MediaWiki Escape </code>&#124;</code>]
* [[Disk Performance]]
* [[Google Cloud CLI]]
* [[Google Cloud CLI]]
* [[LXC/Logrotate|LXC » Logrotate]]
* [[Free Up RAM]]
* [[AWS CLI]]
* [[AWS CLI]]


| valign="top" |
|valign='top'|
 
|}
|}

Latest revision as of 01:21, 16 January 2026

sudo apt -qq update
sudo apt install -y p7zip-full
7z

Compress

Compress

cd /etc/nginx
7z a chorke-nginx-academia.prod.2024-06-28T2023.7z sites-enabled
7z a chorke-nginx-academia.prod.2024-06-28T2023.7z sites-enabled  -psadaqah!
7z a chorke-nginx-academia.prod.2024-06-28T2023.7z sites-enabled '-psadaqah!'
7z a chorke-nginx-academia.prod.2024-06-28T2023.7z sites-enabled '-x!default'
7z a chorke-nginx-academia.prod.2024-06-28T2023.7z sites-enabled '-xr!default'

Decompress

Decompress

7z l chorke-nginx-academia.prod.2024-06-28T2023.7z
7z e chorke-nginx-academia.prod.2024-06-28T2023.7z
7z x chorke-nginx-academia.prod.2024-06-28T2023.7z
7z x chorke-nginx-academia.prod.2024-06-28T2023.7z  -psadaqah!
7z x chorke-nginx-academia.prod.2024-06-28T2023.7z '-psadaqah!'
7z x chorke-nginx-academia.prod.2024-06-28T2023.7z -o./chorke-nginx-academia-production/

Commands

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

Cheatsheet

Cheatsheet

Type Compress Decompress Algorithm
7z time 7z a nginx.2024-06-30T1519.7z  nginx time 7z x nginx.2024-06-30T1519.7z LZMA, LZMA2, PPMd, BZIP2, DEFLATE, Store 🟠
zip time 7z a nginx.2024-06-30T1519.zip nginx time 7z x nginx.2024-06-30T1519.zip DEFLATE, BZIP2, LZMA, Store 🟢
tar.gz time tar cf - nginx|7z a -si nginx.2024-06-30T1519.tar.gz time 7z x nginx.2024-06-30T1519.tar.gz  -so|7z x -si -ttar -onginx DEFLATE=LZ77+Huffman 🟢
tar.xz time tar cf - nginx|7z a -si nginx.2024-06-30T1519.tar.xz -txz time 7z x nginx.2024-06-30T1519.tar.xz  -so|7z x -si -ttar -onginx LZMA2 🟠
tar.bz2 time tar cf - nginx|7z a -si nginx.2024-06-30T1519.tar.bz2 -tbzip2 time 7z x nginx.2024-06-30T1519.tar.bz2 -so|7z x -si -ttar -onginx BZIP2 🟡

DateTime Format

DateTime Format

echo      "$(TZ=UTC-8 date +'%Y-%m-%dT%H%M')"
echo            "$(TZ=UTC-8 date +'%FT%H%M')"
BKP_DATE_N_TIME="$(TZ=UTC-8 date +'%FT%H%M')"
:'
2025-10-10T1010
├─ 2025-10-21
│  ├─ 2025 « %Y
│  ├─   10 « %m
│  └─   10 « %d
└─ T1010
   ├─    T « Time
   ├─   10 « %H
   └─   10 « %M
'

References

References