Cómo abrir, extraer y crear archivos RAR en Linux
RAR es la herramienta más popular para crear y extraer archivos comprimidos de (.rar)
. Cuando descargamos un archivo comprimido de la web, requerimos una herramienta rar para extraerlos.
RAR está disponible gratuitamente en los sistemas operativos Windows para manejar archivos comprimidos, pero desafortunadamente, la herramienta rar no está preinstalada en los sistemas Linux.
Este artículo explica cómo instalar las herramientas de línea de comandos unrar y rar utilizando el archivo oficial binario tar en sistemas Linux para abrir, extraer, descomprimir o descomprimir un archivo.
En las distribuciones basadas en Debian y Ubuntu , puede instalar fácilmente el paquete unrar utilizando el programa apt-get o apt como se muestra.
$ sudo apt-get install unrar Or $ sudo apt install unrar
Si está utilizando la distribución Fedora , puede usar el comando dnf para instalarlo.
$ sudp dnf install unrar
Si está utilizando una distribución CentOS / RHEL , debe descargar el último archivo unrar/rar e instalarlo con los siguientes comandos.
--------------- On 64-bit --------------- # cd /tmp # wget https://www.rarlab.com/rar/rarlinux-x64-5.6.0.tar.gz # tar -zxvf rarlinux-x64-5.6.0.tar.gz # cd rar # sudo cp -v rar unrar /usr/local/bin/ --------------- On 32-bit --------------- # cd /tmp # wget https://www.rarlab.com/rar/rarlinux-5.6.0.tar.gz # tar -zxvf rarlinux-5.6.0.tar.gz # cd rar # sudo cp -v rar unrar /usr/local/bin/
Para abrir/extraer un archivo RAR en el directorio de trabajo actual, simplemente use el siguiente comando con Para abrir/extraer un archivo RAR en una ruta específica o en el directorio de destino, simplemente use Para abrir/extraer un archivo RAR con su estructura de directorios original. simplemente emita el comando debajo de Para listar un archivo dentro de un archivo, use Para probar la integridad de un archivo comprimido, use la opción El comando unrar se usa para extraer, listar o probar archivos de archivo solamente. No tiene ninguna opción para crear archivos RAR en Linux. Por lo tanto, aquí necesitamos instalar la utilidad de línea de comandos RAR para crear archivos comprimidos. Para instalar la opción de comando RAR en Linux, simplemente ejecute el siguiente comando. Para crear un archivo ( RAR ) en Linux, ejecute el siguiente comando con Para eliminar un archivo de un archivo, ejecute el comando. Para recuperar o reparar un archivo o archivos de archivado, ejecute el comando con la opción Para actualizar o agregar archivos al archivo de almacenamiento existente, use el siguiente comando con la opción Ahora, verifique que el archivo tecmint.sql se agregue al archivo comprimido. Esta es una característica muy interesante de la herramienta Rar , nos permite establecer una contraseña para archivar el archivo. Para proteger con contraseña el archivo comprimido use la opción Ahora verifíquelo extrayendo el archivo comprimido y vea si nos solicitará que ingresemos la contraseña que hemos establecido anteriormente. Otra característica interesante de bloqueo de la herramienta rar, proporciona una opción para bloquear un archivo de archivo en particular para que no pueda extraerlo. Para las más opciones y el uso de RAR y Unrar , ejecute el siguiente comando que mostrará una lista de opciones con su descripción. Hemos presentado casi todas las opciones anteriores para los comandos rar y unrar con sus ejemplos. Si cree que nos hemos olvidado de algo en esta lista y desea que agreguemos, por favor, actualícenos utilizando el formulario de comentarios a continuación.# unrar e tecmint.rar
UNRAR 4.20 beta 3 freeware Copyright (c) 1993-2012 Alexander Roshal
Extracting from tecmint.rar
Extracting index.php OK
Extracting index.html OK
Extracting xyz.txt OK
Extracting abc.txt OK
All OK
# unrar e tecmint.rar /home/
UNRAR 4.20 beta 3 freeware Copyright (c) 1993-2012 Alexander Roshal
Extracting from tecmint.rar
Extracting /home/index.php OK
Extracting /home/index.html OK
Extracting /home/xyz.txt OK
Extracting /home/abc.txt OK
All OK
# unrar x tecmint.rar
UNRAR 4.20 beta 3 freeware Copyright (c) 1993-2012 Alexander Roshal
Extracting from tecmint.rar
Creating tecmint OK
Extracting tecmint/index.php OK
Extracting tecmint/index.html OK
Extracting tecmint/xyz.txt OK
Extracting tecmint/abc.txt OK
Creating default OK
Extracting default/index.php OK
Extracting default/index.html OK
Creating include OK
Extracting include/abc.txt OK
Creating php OK
Extracting php/xyz.txt OK
All OK
unrar l tecmint.rar
UNRAR 4.20 beta 3 freeware Copyright (c) 1993-2012 Alexander Roshal
Archive tecmint.rar
Name Size Packed Ratio Date Time Attr CRC Meth Ver
-------------------------------------------------------------------------------
index.php 0 8 0% 18-08-12 19:11 -rw-r--r-- 00000000 m3b 2.9
index.html 0 8 0% 18-08-12 19:11 -rw-r--r-- 00000000 m3b 2.9
xyz.txt 0 8 0% 18-08-12 19:11 -rw-r--r-- 00000000 m3b 2.9
abc.txt 0 8 0% 18-08-12 19:11 -rw-r--r-- 00000000 m3b 2.9
index.php 0 8 0% 18-08-12 19:22 -rw-r--r-- 00000000 m3b 2.9
index.html 0 8 0% 18-08-12 19:22 -rw-r--r-- 00000000 m3b 2.9
abc.txt 0 8 0% 18-08-12 19:22 -rw-r--r-- 00000000 m3b 2.9
xyz.txt 0 8 0% 18-08-12 19:22 -rw-r--r-- 00000000 m3b 2.9
-------------------------------------------------------------------------------
8 0 64 0%
unrar t tecmint.rar
UNRAR 4.20 beta 3 freeware Copyright (c) 1993-2012 Alexander Roshal
Testing archive tecmint.rar
Testing tecmint/index.php OK
Testing tecmint/index.html OK
Testing tecmint/xyz.txt OK
Testing tecmint/abc.txt OK
Testing default/index.php OK
Testing default/index.html OK
Testing include/abc.txt OK
Testing php/xyz.txt OK
All OK
# sudo apt-get install rar
# sudo dnf install rar
# yum install rar
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Dependencies Resolved
=========================================================================================
Package Arch Version Repository Size
=========================================================================================
Installing:
rar i386 3.8.0-1.el5.rf rpmforge 264 k
Transaction Summary
=========================================================================================
Install 1 Package(s)
Upgrade 0 Package(s)
Total download size: 264 k
Is this ok [y/N]: y
Downloading Packages:
rar-3.8.0-1.el5.rf.i386.rpm | 264 kB 00:01
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : rar 1/1
Installed:
rar.i386 0:3.8.0-1.el5.rf
Complete!
rar a tecmint.rar tecmint
RAR 3.80 Copyright (c) 1993-2008 Alexander Roshal 16 Sep 2008
Shareware version Type RAR -? for help
Evaluation copy. Please register.
Creating archive tecmint.rar
Adding tecmint/index.php OK
Adding tecmint/index.html OK
Adding tecmint/xyz.txt OK
Adding tecmint/abc.txt OK
Adding tecmint OK
Done
rar d filename.rar
rar r filename.rar
RAR 3.80 Copyright (c) 1993-2008 Alexander Roshal 16 Sep 2008
Shareware version Type RAR -? for help
Building fixed.tecmint.rar
Scanning...
Data recovery record not found
Reconstructing tecmint.rar
Building rebuilt.tecmint.rar
Found tecmint\index.php
Found tecmint\index.html
Found tecmint\xyz.txt
Found tecmint\abc.txt
Found tecmint
Done
rar u tecmint.rar tecmint.sql
RAR 3.80 Copyright (c) 1993-2008 Alexander Roshal 16 Sep 2008
Shareware version Type RAR -? for help
Evaluation copy. Please register.
Updating archive tecmint.rar
Adding tecmint.sql OK
Done
rar l tecmint.rar
RAR 3.80 Copyright (c) 1993-2008 Alexander Roshal 16 Sep 2008
Shareware version Type RAR -? for help
Archive tecmint.rar
Name Size Packed Ratio Date Time Attr CRC Meth Ver
-------------------------------------------------------------------------------
index.php 0 8 0% 18-08-12 19:11 -rw-r--r-- 00000000 m3b 2.9
index.html 0 8 0% 18-08-12 19:11 -rw-r--r-- 00000000 m3b 2.9
xyz.txt 0 8 0% 18-08-12 19:11 -rw-r--r-- 00000000 m3b 2.9
abc.txt 0 8 0% 18-08-12 19:11 -rw-r--r-- 00000000 m3b 2.9
tecmint 0 0 0% 18-08-12 19:23 drwxr-xr-x 00000000 m0 2.0
tecmint.sql 0 8 0% 18-08-12 19:46 -rw-r--r-- 00000000 m3b 2.9
-------------------------------------------------------------------------------
6 0 40 0%
rar a -p tecmint.rar
Enter password (will not be echoed):
Reenter password:
AR 3.80 Copyright (c) 1993-2008 Alexander Roshal 16 Sep 2008
Shareware version Type RAR -? for help
Evaluation copy. Please register.
Updating archive tecmint.rar
Updating tecmint.sql OK
Done
rar x tecmint.rar
RAR 3.80 Copyright (c) 1993-2008 Alexander Roshal 16 Sep 2008
Shareware version Type RAR -? for help
Extracting from tecmint.rar
Creating tecmint OK
Extracting tecmint/index.php OK
Extracting tecmint/index.html OK
Extracting tecmint/xyz.txt OK
Extracting tecmint/abc.txt OK
Enter password (will not be echoed) for tecmint.sql:
Extracting tecmint.sql OK
All OK
rar k tecmint.rar
RAR 3.80 Copyright (c) 1993-2008 Alexander Roshal 16 Sep 2008
Shareware version Type RAR -? for help
Processing archive tecmint.rar
Locking archive
Done
# man unrar
# man rar