How to Keep Docker Containers Running

Docker containers, when run in detached mode (the most common -d option), are designed to shut down immediately after the initial entrypoint command (program that should be run when container is built from image) is no longer running in the foreground. This can cause problems because often servers or services running in Docker containers are

read more

How to Uppercase/Lowercase Text in Unix/Linux

Uppercasing and lowercasing is a common task when working with text. Below are examples of doing this with standard Linux/Unix utilities. Lowercasing text with tr

Uppercasing text with tr

Lowercasing text with awk

Uppercasing text with awk

Lowercasing text with sed

Uppercasing text with sed

How to Uppercase/Lowercase text with sed

sed is a common Linux/Unix utility used to parse and transform text. Below are examples of uppercasing and lowercasing text with sed: Uppercasing Text with sed

[a-z] is the regular expression which will match lowercase letters. \U& is used to replace these lowercase letters with the uppercase version. Lowercasing Text with sed

[A-Z]

read more

Convert JSON to TSV with jq

jq is a lightweight JSON command line processor that makes many JSON processing tasks very easy. A common task when working with JSON is to convert records into a TSV (tab delimited) format. Below are examples of how to convert JSON to TSV with jq. Converting JSON to TSV In order to convert JSON to

read more

Convert JSON to CSV with jq

jq is a lightweight JSON command line processor that makes many JSON processing tasks very easy. A common task when working with JSON is to convert records into a CSV format. Below are examples of how to convert JSON to CSV with jq. Converting JSON to CSV In order to convert JSON to CSV with

read more

Linux sort Command Examples

What is Linux sort? sort is a very useful command line utility used to sort the lines of a file or input stream. sort can be used to sort input by entire lines, single columns, or different column ranges in a variety of ways. Sorting by Entire Lines The default behavior of the sort command

read more

Count JSON Array Elements with jq

Sometimes when working with JSON on the command line, it is helpful to know how many elements exist in a JSON array. Fortunately this is easy to do with jq. jq is a lightweight, easy to use, command line JSON processor. *More information about jq can be found at https://stedolan.github.io/jq/manual/. Counting Array Elements in single

read more

Count the Number of Fields in JSON with jq

Sometimes when working with JSON on the command line, it is helpful to know how many fields exist in each document. Fortunately this is easy to do with jq. jq is a lightweight, easy to use, command line JSON processor. Counting Fields in single JSON String If you want to test individual JSON strings, you

read more

How to Display Window Tabs in Linux Screen

screen is a Linux program that allows users to create and manage multiple terminal instances. Using tabs to visually track multiple terminal windows is very convenient and luckily not too hard to do. Screen Window Tabs Example Here is an example of how to display window tabs in Linux screen. Simply add the below line

read more