Terminator

Multiple Terminals Using Terminator On Linux

How about if you could have a multi-window terminal where, at will, you could press a key and it would be immediately copied to all (or a selection of) windows? How about if you could fit all terminal windows in one big window, without big and bulky borders loosing “precious” screen real estate? These, and more, are basic features of terminator, the handy Linux terminal utility.

Read more

How to Make Decimal Calculations In Bash Using bc

How to Make Decimal Calculations In Bash Using bc

Decimal calculations are sometimes required in Bash. The standard calculation Bash programming idiom ($[]) is unable to provide a decimal output. Whilst we can trick it into calculating (but not generating) a decimal output by multiplying the numbers by for example a factor of 1000 and then doing an text based splitting, this is a ugly workaround and creates complex code. There is however a utility in Bash which can natively do decimal based calculations without any tricks or workarounds!

In this tutorial you will learn:

  • How to use bc to perform decimal calculations
  • How to make decimal based calculations at the Bash command line or from in your scripts
  • How to use variables to store the results produced by bc
  • How to use variables in further calculations
  • How to avoid Bash variable quoting errors

Read more

Useful Bash command line tips and tricks examples - Part 3

Useful Bash command line tips and tricks examples – Part 3

Bash is a varied shell interface with many programming options, and a rich instructional language. It is easy to miss Bash features and dynamics, so this series introduces a number of tips, tricks, examples and gotchas when it comes to using Bash. For the first two article in this series, please see our article Useful Bash command line tips and tricks examples part 2 and Useful Bash command line tips and tricks examples part 3.

In this tutorial series you will learn:

  • Useful Bash command line tips, tricks and methods
  • How to interact with the Bash command line in an advanced manner
  • How to sharpen your Bash skills overall and become a more proficient Bash user

Read more

Useful Bash Command Line Tips and Tricks Examples - Part 4

Useful Bash Command Line Tips and Tricks Examples – Part 4

Continuing our series on useful Bash command line tips and tricks, in today’s article, we will explore grepping only what you need, and start of with a primer on pwd and how to discover the path a script was started from.

In this tutorial you will learn:

  • Useful Bash command line tips, tricks and methods
  • How to interact with the Bash command line in an advanced manner
  • How to sharpen your Bash skills overall and become a more proficient Bash user

Read more

Useful Bash Command Line Tips and Tricks Examples - Part 5

Useful Bash Command Line Tips and Tricks Examples – Part 5

In this article, we will explore user input: for all those times you want to ask the user to ‘press enter to continue’, or to actually read a string of input and store it into a variable for later processing. We will also look at how to find manual pages for built-in commands which otherwise may not seem to be available.

In this tutorial you will learn:

  • Useful Bash command line tips, tricks and methods
  • How to interact with the Bash command line in an advanced manner
  • How to sharpen your Bash skills overall and become a more proficient Bash user

Read more

Useful Bash command line tips and tricks examples - Part 1

Useful Bash command line tips and tricks examples – Part 1

The Bash command line provides nearly limitless power when it comes to executing nearly anything you want to do. Whether it is processing a set of files, editing a set of documents, handling big data, managing a system or automating a routine, Bash can do it all. This series, of which today we present the first part, is sure to arm you with the tools and methods you need to become a much more proficient Bash user. Even already advanced users will likely pickup something new and exciting. Enjoy!

In this tutorial you will learn:

  • Useful Bash command line tips, tricks and methods
  • How to interact with the Bash command line in an advanced manner
  • How to sharpen your Bash skills overall and become a more proficient Bash user

Read more

Bash command line tips and tricks

The Bash command line provides nearly limitless power when it comes to executing nearly anything you want to do. Whether it is processing a set of files, editing a set of documents, handling big data, managing a system or automating a routine, Bash can do it all.

This tutorial is sure to arm you with the tools and methods you need to become a much more proficient Bash user. Even already advanced users will likely pickup something new and exciting.

Read more

Useful Bash command line tips and tricks examples - Part 2

Useful Bash command line tips and tricks examples – Part 2

In this series we are exploring various tips, tricks and Bash command line examples which will help you become a more advanced Bash user and coder. Bash provides a rich scripting and coding language which puts the power back in the hands of the user and developer. Bash also allows you to learn as you go along, thereby making it a more enjoyable experience. For the first article in our series, please see our article Useful Bash command line tips and tricks examples part 1.

In this tutorial series you will learn:

  • Useful Bash command line tips, tricks and methods
  • How to interact with the Bash command line in an advanced manner
  • How to sharpen your Bash skills overall and become a more proficient Bash user

Read more

Bash Background Process Management

Bash Background Process Management

There are many times when a Bash developer or user will want to run a process in the background, either from the command line or from inside a bash script, and then handle that same process again later. There are various command line tools which allow one to do so. Being able to start, manage and destroy background processes is a requirement for many more advanced level tasks, especially in the areas of advanced scripting and process control.

In this tutorial you will learn:

  • How to start, handle and/or manage, and destroy background processes
  • What command line tools are available to assist you with Bash process management
  • Examples highlighting the use of background processes at the Bash command line
Bash Background Process Management

Bash Background Process Management

Read more

Correct Variable Parsing and Quoting in Bash

Correct Variable Parsing and Quoting in Bash

Incorrect quoting in original source code can easily lead to bugs when the input provided by users is not as expected or not uniform. Over time, when Bash scripts change, an unforeseen side effect of an incorrectly quoted variable can lead to a bug even in otherwise untouched code. This is even more important for security related applications which may be prone to hacking attempts. Learn how to do quoting and variable parsing/validation properly from the outset, and avoid many of these issues! Let’s get started…

In this tutorial series you will learn:

  • How to quote your Bash variables properly
  • The caveats and results of incorrect quoting
  • How to ensure variable values are what they are supposed to be
  • How to check for empty, numeric and text based variable values
Correct Variable Parsing and Quoting in Bash

Correct Variable Parsing and Quoting in Bash

Read more

Linux Subshells for Beginners With Examples

Linux Subshells for Beginners With Examples

Making use of subshells in Bash provides you with an ability to generate context sensitive information from right within your Bash command. For example, if you want to modify a text string right inside an echo statement, then this can be done easily with subshells.

In this tutorial you will learn:

  • How to use employ the use of subshells in Bash
  • How to use subshells to obtain context sensitive information
  • Basic Bash subshell usage examples

Read more