Inicio » Servidores Virtuales Privados
Esta guía muestra cómo comprimir, descomprimir y listar el contenido de los formatos más comunes en servidores Linux: .tar
, .tar.gz
, .bz2
, .zip
y .zst
.
Los comandos funcionan tanto en Ubuntu 22.04 como en AlmaLinux 8.
tar -cvf archivo.tar carpeta_o_archivos
tar -tvf archivo.tar
tar -xvf archivo.tar
tar -czvf archivo.tar.gz carpeta_o_archivos
tar -tzvf archivo.tar.gz
tar -xzvf archivo.tar.gz
tar -cjvf archivo.tar.bz2 carpeta_o_archivos
tar -tjvf archivo.tar.bz2
tar -xjvf archivo.tar.bz2
sudo apt install zip unzip -y # Ubuntu
sudo dnf install zip unzip -y # AlmaLinux
zip -r archivo.zip carpeta_o_archivos
unzip -l archivo.zip
unzip archivo.zip
sudo apt install zstd -y # Ubuntu
sudo dnf install zstd -y # AlmaLinux
tar --zstd -cvf archivo.tar.zst carpeta_o_archivos
tar --zstd -tvf archivo.tar.zst
tar --zstd -xvf archivo.tar.zst
tar -czvf backup.tar.gz archivo1 archivo2 archivo3
tar -xzvf archivo.tar.gz -C /ruta/destino
gzip -l archivo.tar.gz
unzip -t archivo.zip
gzip archivo.txt
gunzip archivo.txt.gz
Formato | Comprimir | Ver contenido | Descomprimir |
---|---|---|---|
.tar | tar -cvf archivo.tar carpeta |
tar -tvf archivo.tar |
tar -xvf archivo.tar |
.tar.gz | tar -czvf archivo.tar.gz carpeta |
tar -tzvf archivo.tar.gz |
tar -xzvf archivo.tar.gz |
.tar.bz2 | tar -cjvf archivo.tar.bz2 carpeta |
tar -tjvf archivo.tar.bz2 |
tar -xjvf archivo.tar.bz2 |
.zip | zip -r archivo.zip carpeta |
unzip -l archivo.zip |
unzip archivo.zip |
.tar.zst | tar --zstd -cvf archivo.tar.zst carpeta |
tar --zstd -tvf archivo.tar.zst |
tar --zstd -xvf archivo.tar.zst |