Benchmarking compression results of a directory with 7zip, the winner of our test

Best compression tool on Linux

There’s no shortage of compression tools available for Linux systems. Having so many choices is ultimately a good thing, but it can also be confusing and make it more difficult to select a compression method to use on your own files. To complicate things further, there is no objectively best tool for every user or system, and we’ll explain why.

When it comes to compression, there are two benchmarks that we need to be concerned with. One is how much space is saved, and the other is how fast the compression process takes place. Another thing to take into consideration is how widespread a certain compression tool is. For example, it’d be much more appropriate to package files into a .zip archive instead of .tar.gz if you know that the archive will need to be opened on a Windows system. Conversely, a .tar.gz archive makes more sense on Linux, since tar files save file permissions.

In this guide, we’ll be looking at a variety of compression tools that are available on the most popular Linux distributions. We’ll compare their compression ratio, speed, and other features. By the end of this guide, you’ll be armed with enough information to choose the best compression tool for any given scenario.

In this tutorial you will learn:

  • Benchmark results of various compression utilities
  • How to conduct your own tests to measure compression ratio and speed
  • Picking a compression utility based on compatibility

Read more

Searching for packages to install on Kali Linux

How to search for extra hacking tools on Kali

Kali Linux already comes with a lot of ethical hacking and penetration tools out of the box. There are even more tools available from package repositories, but sifting through hundreds of tools and finding the ones you want to install can be challenging.

We aim to make the task easier in this guide, by showing you how to search for more software and install the tools on your system. If Kali doesn’t include some of your favorite tools by default, or you just want to browse the selection of software to see what else might be available, the steps below will help you find useful tools to install.

In this tutorial you will learn:

  • How to search for packages with apt-cache
  • How to search for packages with aptitude
  • GUI software installers
  • How to search for Kali packages online
Searching for packages to install on Kali Linux

Searching for packages to install on Kali Linux

Read more

Split window terminal multiplexer

An introduction to terminal multiplexers

April 20, 2016
by Rares Aioanei

Introduction

If you’re new to server administration and command-line, perhaps you haven’t heard of terminal multiplexers or what they do. You want to learn how to be a good Linux sysadmin and how to use the tools of the trade. Or perhaps you’re a seasoned administrator already and administer quite a few machines, and want to make your life a little easier. Or maybe you’re somewhere in between.

Either way, this article will explain what terminal multiplexers are, what they do and most importantly, how you can benefit from using them.

A terminal multiplexer is nothing more than a program that allows its user to multiplex one or more virtual sessions, so the user can have several sessions inside one single terminal. One of the most useful features of such programs is the fact that users can attach and detach such sessions; how is this useful will become clear shortly.

Use cases

Persistent sessions

Let’s say you have to administer a remote server via ssh/command-line but your connection is not very stable. That means you have to reconnect often and don’t want to start work all over again. Terminal multiplexers offer the feature of saving your sessions between connections so you can continue just where you started.

Please note that such sessions are not persistent between reboots (in our case above, reboots of the server you’re connecting to) so it’s best to know this in order not to expect such a feature. The reason for this is the fact that the multiplexer runs shell sessions, from which you may be running a text editor, a monitoring tool and whatnot. Since all those processes will not be there anymore after a reboot, there is no reason why this feature should be implemented as it would not have any real use.

We spoke in our introduction about attaching and detaching : this is exactly what this feature does. Continuing with our use case, where you have an unstable connection, once you get disconnected, you can just ssh into the server again and reattach to the running session (or choose between sessions to reattach to) and you’ll be right where you
left off.

Read more

Splitting tar archive into blocks

How to split tar archive into multiple blocks of a specific size

Tar archives can be split into multiple archives of a certain size, which is handy if you need to put a lot of content onto discs. It’s also useful if you have a huge archive that you need to upload, but would rather do it in chunks. In this guide, we’ll show you the commands you need in order to split tar archives into multiple blocks on a Linux system.

This will work regardless of what type of compression (or lack thereof) that you use. So files with extensions like .tar, tar.gz, tar.xz, etc. can all be split into chunks. We’ll also show you how to extract files from archives that have been split into numerous files.

In this tutorial you will learn:

  • How to split tar archives into multiple files
  • How to open split tar archives
Splitting tar archive into blocks

Splitting tar archive into blocks

Read more

Combining files into a split zip archive

How to split zip archive into multiple blocks of a specific size

When compressing large files on a Linux system, it can be handy to split them into multiple blocks of a specific size. This is especially true for squeezing a large archive onto multiple discs, or uploading a large archive online in chunks.

Linux makes this possible with tar files, as we’ve seen in our split tar archive into multiple blocks guide, but you can also do it with zip files.

In this guide, we’ll see the step by step instructions to create a zip archive split into multiple blocks. We’ll also go through the process of unzipping the split archive.

In this tutorial you will learn:

  • How to split zip archives into multiple files
  • How to open split zip archives
Combining files into a split zip archive

Combining files into a split zip archive

Read more

Beginners guide to xz compression on Linux

Beginner’s guide to compression with xz on Linux

xz compression has been rising in popularity because it offers smaller file sizes than gzip and bzip2. You’re still likely to see all three on a Linux system, but you may want to start opting for xz if you want smaller file archives.

In this guide, we’re going to introduce you to xz compression, starting from basic examples to more specific and advanced usage. If you’ve worked with compressed tar files or gzip compression (files with the .tar.gz extension, for example) in the past, you’ll find that xz feels very familiar.

In this tutorial you will learn:

  • How to create xz compressed archives from command line or GUI
  • How to decompress xz archives from command line or GUI
Beginners guide to xz compression on Linux

Beginners guide to xz compression on Linux

Read more

How to create modify and delete users account on Linux

How to create modify and delete users account on Linux

Users account management is one of the fundamental task of every Linux system administrator. In this article we will learn how to create a new user account, how to modify it and how to delete it from the command line using the useradd, usermod and userdel utilities, which are part of the base system.

In this tutorial you will learn:

  • What is the use of the /etc/login.defs file
  • How to create a user account with various options using the useradd command
  • How to modify a user account using the usermod command
  • How to delete a user account using the userdel command

Read more

Unrar on Ubuntu

How to unrar in Ubuntu

Files with a .rar extension are compressed archives, much like a .tar.gz or .zip file. It’s one of many file compression formats that rose to popularity over the years, but requires its own utility to use.

You may have an individual .rar archive such as file.rar, but RAR archives are also known for being split into multiple files, such as file.rar, file.r00, file.r01, etc. In these cases, it’s necessary to open the file.rar file, which will then automatically combine the rest of the files into a single archive and extract its contents.

In this guide, we’ll see how to extract files from a RAR archive on Ubuntu Linux. This will work whether you have an individual .rar file or an archive that’s been split into a sequence of files.

In this tutorial you will learn:

  • How to install unrar utility
  • How to use unrar utility to open rar files

Read more

How to Access Manual Pages for Linux Commands

How to Access Manual Pages for Linux Commands

Regular, when writing a command – both easy and complex ones – one will want to access more detailed information about the command and it’s available options. There is a wealth of information available in the Linux manual pages, and this is provided free of charge, and is available with just a few keystrokes.

In this tutorial you will learn:

  • How to access the manual page for a given command
  • How to access inline help for a given command
  • How to search all manuals for a given search term
  • How to access manual pages for builtin commands
  • How to access the manual using a GUI (graphical user interface)
  • Examples showing various manual usage use cases
How to Access Manual Pages for Linux Commands

How to Access Manual Pages for Linux Commands

Read more

Installing a Snap package on Linux

How to setup Snap package manager on any Linux distro

The Snap package manager, known as snapd, is a relatively new feature in the Linux ecosystem. It allows a user to install Snap packages, called Snaps, across a wide range of Linux distributions and versions. This works differently than the traditional method of installing packages via a package manager like APT, where applications are packaged and installed as part of the operating system.

Snaps are self-contained and run in a sandbox, making new software pretty safe to install. The Snaps can be browsed and installed from the Snapcraft App Store. Snap gives developers an easy way to push updates for their applications, as well as usage data to help them improve.

Newer versions of Ubuntu should already have Snap enabled, as Canonical developed the feature and first introduced it on their own distribution. It’s also available for most other Linux distributions, but must be installed first.

In this guide, we’ll show you how to install the Snap package manager, snapd, on all major Linux systems. We’ll also show how to get started with searching the Snap store, and installing or removing Snaps from your system.

In this tutorial you will learn:

  • How to enable Snap package manager on all major Linux distros
  • How to install and uninstall Snap packages (Snaps)
Installing a Snap package on Linux

Installing a Snap package on Linux

Read more

Bash Advanced Variable Idioms for Case Sensitivity Management

Bash Advanced Variable Idioms for Case Sensitivity Management

Whenever we work with textual strings, sooner or later the issue of case comes up. Does a word need to be fully uppercase, fully lowercase, with a capitalized letter at the start of the word or sentence, and so on.

An idiom is a natural language expression of a simple programming task. For example, in the sleep 10 command (which will pause the terminal one is working in for ten seconds), the word sleep is a natural language expression of what is a time based coding construct, developed in the Bash GNU coreutils software package.

There are a number of special variable-bound idioms (i.e. suffixes which can be added to a variable name, indicating what we would like to do with a given variable), which can be used in Bash to more easily do these types of conversions on the fly instead of having to use for example the Sed Stream Editor with a Regular Expression to do the same.

If you are interested in using regular expressions, have a look at our Bash Regexps For Beginners With Examples Advanced Bash Regex With Examples articles!

This makes working with variables that need case modification, or if statement testing a whole lot easier and provides great flexibility. Idioms can be added directly inside the if statements and do not need to employ a subshell with sed.

While the syntax looks slightly complex to start with, once you learn a little mental support trick to remember the right keys, you will be well on your way to use these idioms in your next script or Bash one-liner script at the command line!

In this tutorial you will learn:

  • How to use the ^, ^^, , and ,, Bash variable suffix idioms
  • How to use a regular expression [] range idiom in combination with these
  • How to use the ^ and , idioms directly from within if statements
  • Detailed examples exemplifying the use of ^, ^^, , and ,,

Read more

Learning Linux commands: dd

Introduction

What you’re reading is only the first of the many articles from the “Learning Linux commands” series. Why would we want to do such a thing? Because it’s useful to you to have every option and possible use of a widely used command all in one place. You will find some options or even some commands that you didn’t even knew existed, and your life as a Linux user / admin will become easier. If you’re not afraid of opening a terminal and know the basics of using a Linux system, this article is for you.

Read more