Skip to main content

4 posts tagged with "linux"

View All Tags

Working with TAR Archives in Linux Command Prompt

· 2 min read
Customer Care Engineer

The TAR format is extremely popular in the Linux world and is the de facto data archiving standard. It can’t compress files by itself but perfectly cooperates with such compression utilities as gzip or bzip2. Therefore, most archives packed with this format that you can find on the web will look as archive_name.tar.gz.

Before You Begin

In most cases, tar is installed by default. To be 100% sure, run the command to install this archiver:

For Debian and Ubuntu:

sudo apt update && sudo apt install tar

For CentOS and Rocky Linux/AlmaLinux:

sudo yum makecache && sudo yum install tar

How to Create a TAR Archive

Without compression:

tar -cvf archive.tar /file/path

Where:

  • -c — to create an archive
  • -v — show details in the terminal (you’ll find it useful if you want to see what’s going on)
  • -f — specify the name of the archive file

With additional compression (for example, gzip):

tar -czvf archive.tar.gz /file/path
  • -z — adds gzip compression.

The second command is preferable in most cases, since additional compression will save time for downloading or uploading a file from or to the server, and the archive will take up less drive space.

How to extract a TAR Archive

For gzip:

tar -xzvf archive.tar.gz

For bzip2:

tar -xjvf archive.tar.bz2

For a uncompressed archive:

tar -xvf archive.tar

Additional Useful Options

  • -t — view the archive contents without unpacking:
tar -tvf archive.tar

Shows a list of archive files in the console, but doesn’t unpack it.

  • -u — update files within the archive:
tar -uf archive.tar /path/to/new_files

Consider the following details when updating a file within the archive:

  • If the archive contains no new_file.txt, it will be added.
  • If the archive already contains a file of the same name, but its contents on the drive have changed, then this file will be updated to the latest version.

You can also use this command to update multiple files at once, for example:

tar -uf archive.tar /path/to/new_files/*.txt

This command will update all txt files in the archive and will add new ones if they haven’t been added before.

Working with RAR Archives in Linux Command Prompt

· 2 min read
Customer Care Engineer

The RAR format is famous for its high compression level, support for data recovery, and high tamper resistance, which made it quite popular in the Windows community. But yet, it’s less popular among Linux users and administrators than a number of other archives. However, you may need to be able to work with it on the server, so let’s take a look at the basic commands and options you’ll need to confidently work with RAR archives in a command prompt.

Before You Begin

Make sure that you have all the required packages installed.

For Debian and Ubuntu:

sudo apt update && sudo apt install rar unrar

For CentOS and Rocky Linux/AlmaLinux:

# Add an additional EPEL repository, since the system ones contain no rar
sudo yum install epel-release
sudo yum makecache && sudo yum install rar unrar

How to Create a RAR Archive

Use the following command to create an archive:

rar a archive.rar /directory/path/

For example:

rar a backup.rar /var/www/html/

How to extract a RAR Archive

To extract the archive in the current directory, use the following command:

unrar x archive.rar

To extract the archive to a directory other than the current one, you need to specify the path to it at the end. For example:

unrar x backup.rar /home/user/backup/

Additional Useful Options

  • -l — show a list of files within the archive without extracting it:
unrar l archive.rar
  • -u — update files within the archive:
rar u archive.rar /path/to/new_files

Consider the following details when updating a file within the archive:

  • If the archive contains no new_file.txt, it will be added.
  • If the archive already contains a file of the same name, but its contents on the drive have changed, then this file will be updated to the latest version.

You can also use this command to update multiple files at once, for example:

rar u archive.rar *.txt

This command will update all txt files in the archive and will add new ones if they haven’t been added before.

  • -p — set a password for the archive:
rar a -p archive.rar /file/path

Working with ZIP Archives in Linux Command Prompt

· 2 min read
Customer Care Engineer

ZIP is one of the most popular archiving formats. Unlike a home PC that allows you to work with such archives in a convenient graphical interface, most servers don’t provide such an opportunity. So, be sure to know the basic commands to perform typical tasks via a command prompt.

Before You Begin

Make sure that you have all the required packages installed.

For Debian and Ubuntu:

sudo apt update && sudo apt install zip unzip

For CentOS and Rocky Linux/AlmaLinux:

sudo yum makecache && sudo yum install zip unzip

How to Create a ZIP Archive

Use the following command to create an archive:

zip -r archive_name.zip /directory/path/

The -r is used to recursively add all files and subdirectories to the archive.

How to extract a ZIP Archive

To extract zip archive you can use the following command:

unzip archive.zip

The contents will be unzipped in the current directory by default. If you want to unzip the archive into another place, use the -d option.

For example:

unzip backup.zip -d /home/user/backup/

Additional Useful Options

  • -l — show a list of files within the archive without unzipping it:
unzip -l archive.zip
  • -u — update a file within the archive:
zip -u archive.zip new_file.txt

Consider the following details when updating a file within the archive:

  • If the archive contains no new_file.txt, it will be added.
  • If the archive already contains a file of the same name, but its contents on the drive have changed, then this file will be updated to the latest version.

You can also use this command to update multiple files at once, for example:

zip -u archive.zip *.txt

This command will update all .txt files in the archive and will add new ones if they haven’t been added before.

  • -e — set a password for the archive:
zip -e archive.zip /file/path

Linux VPS Hosting - What is and How to Choose?

· 3 min read
Customer Care Engineer

What is a Linux VPS?

VPS (Virtual Private Server) is a virtual dedicated server, which is part of a physical server divided into several virtual machines. VPS with Linux is a virtual server running the free and open source Linux operating system. It is a go-to solution for 95-99% of cases.

Benefits of VPS with Linux

A Linux VPS has all the benefits of a physical server, but Linux is free, open source, and gives you full access and control to customize your server as you see fit. There are many Linux distributions available, including CentOS and Ubuntu, each with its own benefits and use cases. Windows operating systems are expensive and offer much less flexibility and customization options.

Linux VPS illustration 1

VPS with Linux provides:

Dedicated Resources:

A certain amount of CPU, RAM, and disk space is guaranteed.

Full control:

Full access to the server and you can install any software compatible with Linux and necessary for your tasks.

Scalability:

It's easy to increase or decrease the resources of your VPS depending on your needs.

Use Cases for a Linux VPS

A Linux VPS can be used for a variety of purposes, including:

Web hosting:

A Linux VPS is a great solution for hosting websites on WordPress, Drupal, OpenCart, Joomla, Magento, and other applications. It provides high performance, reliability, and security.

Development and testing:

A Linux VPS is a great platform for developing and testing software. It allows you to create an isolated development environment that helps to avoid conflicts with other applications.

Data storage:

A Linux VPS can be used to store data. It provides high reliability and security.

Game servers:

A Linux VPS is a popular solution for hosting game servers. It provides high performance and low latency, which is necessary for a good gaming experience.

How to Choose a Linux VPS

When choosing a Linux VPS, you should consider:

Your needs:

What do you need the VPS for? What applications will you be running on it? How many users will be working with the server simultaneously?

The resources you need:

How much CPU, RAM, and storage space will you need?

The Linux distribution:

There are many distributions of Linux available, each with its own features.

The cost:

Consider the price of the hosting itself, as well as any additional costs for a control panel and technical support.

Which disks to choose for a VPS (SSD, NVMe, HDD)

HDD:

The most affordable type of disk. They have a large capacity but low read/write speed, suitable for backup, data storage, and streaming, e.g. video encoding.

SSD:

They are characterized by high read and write speed, but have limitations on data rewriting up to several million operations. Used for databases, high-load applications, and file storage, which require fast access.

NVMe:

They have the highest read and write speeds, several times higher than regular SSDs, but their rewrite resource is no higher than that of regular SSDs. When working with applications requiring high performance, the disk resource can be exhausted quickly. Suitable for storing a lot of files, or for a database if the main load is reading.

Linux VPS illustration 2

We regularly update our OS templates, so you can always install the latest version of a particular Linux distribution on your server.

The most popular distributions are: Ubuntu, Debian, Alma, and Rocky.

Ubuntu:

One of the most popular Linux distributions. It is easy to use and has a large community of users. Suitable for beginners and experienced users. Offers a wide range of software. If you need help deciding which distribution to choose, we recommend starting with Ubuntu.

Debian:

A stable and reliable Linux distribution. Suitable for servers that need to run without interruption. Offers a wide selection of software packages. Ideal for those who value stability and security.

AlmaLinux:

A new distribution created by the CentOS community. Compatible with CentOS Stream. Offers high stability and security. Ideal for those who want to use CentOS Stream without a subscription.

Rocky Linux:

Another new distribution created by the CentOS community. Compatible with Red Hat Enterprise Linux. High performance and reliability. Ideal for those who want to use Red Hat Enterprise Linux without paying.

Configure your Linux VPS

Choose one of our tariffs, according to the parameters of your project and your server management skills:

Virtual servers VPS

Fully managed VPS hosting

kodu.cloud tariff includes:

–automatic backup

24/7/365 premium technical support

free, easy, and intuitive server control panel FASPANEL