Zip: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(2 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 zip unzip
|valign='top' style='width:50%'|
unzip -V
<syntaxhighlight style='margin:3px 0' lang='bash'>
zip -V
sudo apt -qq update
sudo apt install -y zip unzip
unzip -V
zip -V
</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
zip -r chorke-nginx_academia-production-D20240628-T2023-ZP0800.zip sites-enabled
zip -r chorke-nginx-academia.prod.2024-06-28T2023.zip sites-enabled
zip -r chorke-nginx_academia-production-D20240628-T2023-ZP0800.zip sites-enabled -x default
zip -r chorke-nginx-academia.prod.2024-06-28T2023.zip sites-enabled -x default
</syntaxhighlight>
</syntaxhighlight>
|}


==Decompress==
==Decompress==
<syntaxhighlight lang="bash">
{|class='wikitable mw-collapsible' style='width:100%;margin:3px 0'
unzip -l chorke-nginx_academia-production-D20240628-T2023-ZP0800.zip
!scope='col' style='text-align:left'|
unzip    chorke-nginx_academia-production-D20240628-T2023-ZP0800.zip
Decompress
unzip    chorke-nginx_academia-production-D20240628-T2023-ZP0800.zip -d chorke-nginx-academia-production
|-
|valign='top'|
<syntaxhighlight style='margin:3px 0' lang='bash'>
unzip -l chorke-nginx-academia.prod.2024-06-28T2023.zip
unzip    chorke-nginx-academia.prod.2024-06-28T2023.zip
unzip    chorke-nginx-academia.prod.2024-06-28T2023.zip -d chorke-nginx-academia-production
</syntaxhighlight>
|}
 
==Commands==
{|class='wikitable mw-collapsible' style='width:100%;margin:3px 0'
!scope='col' style='text-align:left' colspan='2'|
Commands
|-
|valign='top' style='width:50%'|
<syntaxhighlight style='margin:3px 0' lang='text'>
-r: Recursive child folder
-x: Exclude file from the archive
-l: List the contents of the archive
-f: Specifies the name of the archive
</syntaxhighlight>
</syntaxhighlight>


==Explanation==
|valign='top' style='width:50%'|
-r: Recursive child folder
|}
-x: Exclude file from the archive
-l: List the contents of the archive
-f: Specifies the name of the archive


==DateTime Format==
==DateTime Format==
<syntaxhighlight lang="bash">
{|class='wikitable mw-collapsible' style='width:100%;margin:3px 0'
echo "$(date +'D%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')"
:'
:'
D20240628-T2023-ZP0800
2025-10-10T1010
├─ D20240628
├─ 2025-10-21
│  ├─ D    « Date
│  ├─ 2025 « %Y
│  ├─ 2024 « %Y
│  ├─  10 « %m
│  ├─ 06   « %m
│  └─  10 « %d
│  └─ 28   « %d
└─ T1010
├─ -T2023
  ├─    T « Time
│  ├─ -   « -
  ├─  10 « %H
│  ├─ T   « Time
  └─  10 « %M
│  ├─ 20   « %H
│  └─ 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%'|
* [[7Zip]]
* [[7Zip]]
* [https://en.wikipedia.org/wiki/ZIP_(file_format) ZIP]
* [https://en.wikipedia.org/wiki/ZIP_(file_format) ZIP]
Line 55: Line 89:
* [[Jar]]
* [[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 75: Line 105:
* [[TMux]]
* [[TMux]]


| valign="top" |
|valign='top'|
* [[Chorke Academia Backup]]
* [[Chorke Academia Backup]]
* [[Google Cloud CLI]]
* [[Google Cloud CLI]]
* [[AWS CLI]]
* [[AWS CLI]]


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

Latest revision as of 01:58, 16 January 2026

sudo apt -qq update
sudo apt install -y zip unzip
unzip -V
zip -V

Compress

Compress

cd /etc/nginx
zip -r chorke-nginx-academia.prod.2024-06-28T2023.zip sites-enabled
zip -r chorke-nginx-academia.prod.2024-06-28T2023.zip sites-enabled -x default

Decompress

Decompress

unzip -l chorke-nginx-academia.prod.2024-06-28T2023.zip
unzip    chorke-nginx-academia.prod.2024-06-28T2023.zip
unzip    chorke-nginx-academia.prod.2024-06-28T2023.zip -d chorke-nginx-academia-production

Commands

Commands

-r: Recursive child folder
-x: Exclude file from the archive
-l: List the contents of the archive
-f: Specifies the name of the archive

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