Compress file or directory using RAR archive tool on Linux shell

Here is a quick config tip on how to compress and extract files using RAR archive utility. First let’s see how we can compress directory using RAR. In our example we have a directory called my_files containing five files:

$ mkdir my_files
$ touch my_files/file{1..5}
$ ls my_files/
file1  file2  file3  file4  file5

To compress entire directory using RAR archive tool we use rar’s a command. The below command will create a RAR archive called my_files.rar containing all five above files:

$ rar a my_files.rar my_files/

Creating archive my_files.rar

Adding    my_files/file5                                              OK 
Adding    my_files/file4                                              OK 
Adding    my_files/file3                                              OK 
Adding    my_files/file2                                              OK 
Adding    my_files/file1                                              OK 
Done
$ ls -l my_files.rar 
-rw-rw-r--. 1 lrendek lrendek 307 Nov  3 06:55 my_files.rar

Read more

How to extract a specific file from gzip compressed archive tarball

In order to extract a specific file from gzip compressed archive tarball you first need to know the full path to this file. Consider a following example.

$ tar tzf to-gzip.tar.gz
to-gzip/
to-gzip/file10.txt
to-gzip/file9.txt
to-gzip/file8.txt
to-gzip/file7.txt
to-gzip/file6.txt
to-gzip/file5.txt
to-gzip/file4.txt
to-gzip/file3.txt
to-gzip/file2.txt
to-gzip/file1.txt

Read more

Zip folder in Linux

Zip folder in Linux

If you have a folder that’s full of files and need to send it to someone or otherwise store it efficiently, archiving the folder into a .zip file is a good way to do it. Of course, on Linux systems, it’s probably more common to come across compressed tar files, but zip archives are still ubiquitous and a perfectly viable choice.

In this guide, we’ll show you how to compress (or “zip”) a folder on all major Linux distributions. We’ll be covering the steps for doing so on the command line as well as from the GNOME and KDE graphical desktop environments. Choose whichever method you find most appropriate when creating your zip file.

In this tutorial you will learn:

  • How to zip a folder from Linux command line
  • How to zip a folder from GNOME GUI
  • How to zip a folder from KDE GUI
Zip folder in Linux

Zip folder in Linux

Read more

How to configure smartd and be notified of hard disk problems via email

How to configure smartd and be notified of hard disk problems via email

In the article about checking an hard drive health using smartctl we talked about the smartmontools package, and we saw that it provides two components: a command line utility (smartctl) and a daemon, smartd, we can use to schedule operations. We focused on the usage of the former and we saw what are the S.M.A.R.T tests we can run and how to actually run them.

This time, we will talk about the smartd daemon: we will see how to schedule tests and how to configure it to so to be notified via email when an error is found on a storage device. In the course of the article I will assume the smartmontools package to be already installed. Please refer to the aforementioned article for installation instructions.

In this tutorial you will learn:

  • How to configure the smartd daemon
  • What is the meaning of some of the more used directives that can be used with smartd
  • How to configure msmtp to forward email to gmail smtp server for messages to be delivered externally
  • How to test the configuration
How to configure smartd and be notified of hard disk problems via email

How to configure smartd and be notified of hard disk problems via email

Read more

How to check an hard drive health from the command line using smartctl

How to check an hard drive health from the command line using smartctl

The smartmontools package is generally available in the default repositories of all the major Linux distributions. It contains two utilities useful to check the status of storage with S.M.A.R.T support (Self Monitoring Analysis and Reporting Technology): smartcl and smartd. The former is the utility we use directly to check S.M.A.R.T attributes, run tests, or perform other actions; the latter is the daemon which can be used to schedule operations in the background. In this tutorial we will learn the basic usage of smartctl.

In this tutorial you will learn:

  • How to install smartmontools package on various distributions
  • What are the differences between the S.M.A.R.T self-tests
  • How to use smartctl to check the health of a storage device
  • How to run tests on a storage device from the command line

Read more

How to benchmark Disk performance on Linux

How to benchmark Disk performance on Linux

Just bought the latest and greatest – and especially fastest – SDD? Or upgraded your phone’s microSD memory card? Before you start using your shiny new hardware, you may want to run a performance check against the drive. Is the write and read speed up to manufacturer’s specifications? How does your performance compare with that of others? Is that 1TB flash drive you bought on an auction site from China really as fast as the listing said it was? Let us find out!

In this tutorial you will learn:

  • What CLI (Command Line Interface: your Bash or other terminal environment) disk performance measuring tools are available
  • What GUI (Graphical User Interface: your desktop environment) disk performance measuring tool we recommend
  • How to effectively measure disk performance in a straightforward manner
  • Discover and learn with various disk performance measuring examples
  • How to get a sense for the quality of disk/flash hardware you own

Read more

Live CD/DVD Linux Download

Live CD/DVD Linux Download

In this article, we’ll cover and compare some of the most popular Linux distributions to use for a live CD/DVD. Furthermore, you’ll be given the information you need to make a decision about which one to use, as well as the links to the official Linux downloads pages for each Linux distribution.

Many Linux distributions offer an environment that you can boot your computer into without having to install anything to a hard drive. For some Linux distros, this is actually their main purpose. This is called a “live file system” and it allows you to boot into Linux like normal from a CD, DVD, or USB drive.

With a live file system, changes you make normally aren’t saved after a reboot. When you boot to a live CD/DVD/USB, system files and everything else are stored temporarily in RAM, and RAM is always cleared when a system shuts down or reboots.

Read more

foremost-manual

How to recover deleted files with foremost on Linux

In this article we will talk about foremost, a very useful open source forensic utility which is able to recover deleted files using the technique called data carving. The utility was originally developed by the United States Air Force Office of Special Investigations, and is able to recover several file types (support for specific file types can be added by the user, via the configuration file). The program can also work on partition images produced by dd or similar tools.

In this tutorial you will learn:

  • How to install foremost
  • How to use foremost to recover deleted files
  • How to add support for a specific file type

Read more

destroyed-hard-drive

Hard drive shredding on Linux

When we delete a file from a filesystem, the data is not physically removed: the operating system simply marks the area previously occupied by the file, as free and makes it available to store new information. The only way to make sure data is actually removed from a device is to override it with other data. We may want to perform such operation for privacy reasons (maybe we plan to sell the device and we want to be sure the new owner cannot access our data), or maybe to prepare a device for encryption. In this tutorial we will see some tools we can use to completely wipe data on a device

In this tutorial you will learn:

  • How to shred data using dd
  • How to secure-erase files and devices using the shred utility
  • How to overwrite data using badblocks

Read more

Google Drive Ubuntu 18.04 - Launch Online Accounts

Google Drive on Ubuntu 18.04 Bionic Beaver Linux

Objective

The objective is to seamlessly provide access to Google Drive on Ubuntu 18.04. Firstly, we will access Google Drive via Gnome build-in feature Online Accounts.

Later, as an alternative, this tutorial will explain how to install google drive tool: google-drive-ocamlfuse via PPA and mount Google Drive remotely directly to user’s home directory.

Operating System and Software Versions

  • Operating System: – Ubuntu 18.04 Bionic Beaver

Requirements

Privileged access to your Ubuntu System as root or via sudo command is required.

Conventions

Read more

Install AWS CLI on Ubuntu 18.04 Bionic Beaver Linux

Objective

The objective is to install AWS CLI on Ubuntu 18.04 Bionic Beaver Linux.

This article will describe a procedure on how to install AWS CLI on Ubuntu 18.04 from a standard Ubuntu repository using the apt command as well as how to install AWS CLI using the snap package.

Operating System and Software Versions

  • Operating System: – Ubuntu 18.04 Bionic Beaver

Requirements

Privileged access to your Ubuntu System as root or via sudo command is required.

Conventions

Read more

How to install Fedora/RHEL/CentOS via kickstart on an existing LUKS device

How to install Fedora/RHEL/CentOS via kickstart on an existing LUKS device

Kickstart installations let us easily script and replicate unattended or semi-unattended installations of Fedora, Red Hat Enterprise Linux or CentOS. The instructions needed to install the operating system are specified, with a dedicated syntax, inside a Kickstart file which is passed to the Anaconda installer. In this tutorial we will see how to reuse an already existing LUKS (Linux Unified Keys Setup) container when performing a Kickstart installation: this is something that cannot be achieved just with Kickstart instructions and requires some extra steps.

In this tutorial you will learn:

  • How to use an existing LUKS container when performing a Kickstart installation of Fedora, RHEL or CentOS
  • How to create and use an updates.img file to be used with the Anaconda installer.

Read more