Hello, fellow primates! Welcome back to the jungle of archive files. If you’re going bananas over big files, let’s squash them into a neat RAR file for you! Using the command line to create RAR files is as easy as bundling bananas together. So, let’s stop monkeying around and get started!
Table of contents
- Method 1: Create RAR Files Using Command Line
- Method 2: Create RAR Files with Maximum Compression Using Command Line
- Method 3: Compress a Folder Recursively Using Command Line
- Method 4: Add More Files to an Existing RAR File Using Command Line
- Method 5: Create a Password Protected RAR File Using Command Line
Video guide showing how to create RAR files on the command line using terminal.
How To Create RAR Files Using Command Line
Creating RAR files on the command line is easy. Here’s how you do it:
-
Install RAR: First, you need to install RAR. It’s like getting the right tool to bundle your bananas. You can install it using the following command on Debian based linux systems (Ubuntu, Mint):
sudo apt-get install rar
-
Open Terminal on Directory: Open up your file manager and find the directory where your rar archive is located. Click the three dots and click on (Open in terminal). It’s like the tree where all the magic happens.
-
Compress Command: For a specific file use:
rar a yourfile.rar yourfile
for all files in directory, use * wildcard:rar a yourfile.rar *
This is the magic spell that bundles your files into a neat RAR file. Replace ‘yourfile’ with the name of the file you want to compress or use * to indicate all files in the directory.Remember, when it comes to archiving software, it’s a jungle out there! But with these command line tips, you’ll be the king of the jungle in no time. Happy compressing!
How To Create RAR Files with Maximum Compression Using Command Line
Want to squash your files even more? Here’s how you do it:
-
Open Terminal on Directory: Open up your file manager and find the directory where your rar archive is located. Click the three dots and click on (Open in terminal). It’s like the tree where all the magic happens.
-
Compress Command: Type
rar a -m5 yourfile.rar yourfile
The -m5 switch is the magic spell that squashes your files to their smallest size.
How To Compress a Folder Recursively Using Command Line
Got a whole tree of files to compress? No problem!
-
Open Terminal on Directory: Open up your file manager and find the directory where your rar archive is located. Click the three dots and click on (Open in terminal). It’s like the tree where all the magic happens.
-
Compress Command: Type
rar a -r yourfile.rar yourfolder/**
The -r switch is the magic spell that compresses all the files in your folder and its subfolders.
How To Add More Files to an Existing RAR File Using Command Line
Got more bananas for your bunch? Here’s how you add them:
-
Open Terminal on Directory: Open up your file manager and find the directory where your rar archive is located. Click the three dots and click on (Open in terminal). It’s like the tree where all the magic happens.
-
Add Command: Type
rar a yourfile.rar newfile
This is the magic spell that adds more files to your RAR file. Replace ‘newfile’ with the name of the file you want to add.
How To Create a Password Protected RAR File Using Command Line
Want to protect your bananas from other monkeys? Here’s how you do it:
-
Open Terminal on Directory: Open up your file manager and find the directory where your rar archive is located. Click the three dots and click on (Open in terminal). It’s like the tree where all the magic happens.
-
Compress Command: Type
rar a -p yourfile.rar yourfile
The -p switch is the magic spell that protects your bananas with a password. You’ll be prompted to enter a password after you type the command.
It will ask you to re-enter your password.
Remember, with the command line, you’re the king of the jungle! Happy compressing!