Sorting a list in lexographic order using bash

May 26, 2018
bash linux sort

When sorting in bash, the locale can interfere with a strict lexicographical sort order. The solution is to temporarily reset the locale of the shell.

As an example, a strict lexicographical directory listing -

<span class="s1">ls | LC_ALL=C sort</span>

Extract the size of a file from a bash script

May 26, 2018
linux stat bash

Setting the timezone on AWS Linux AMI from command line

May 7, 2018
aws linux timezone

Setting the hostname on AWS Linux AMI from command line

May 6, 2018
aws hostname linux