Linux

Column formatting

Here is a quick tip on how to make the output of some tools prettier, for example we can use the mount command which by default looks like this:

Using the column command with the -t option we can…Continue Reading →

Squashing spaces

If we want to remove extra spaces in a text like this:

You could be tempted to use sed, but there is a simpler way using tr

And we end up with:

With tr you canĀ also delete…Continue Reading →

Variables with Awk

Awk comes with some predefined variables, like NF for number of fields or OFS for field separator. If you wanna know more about these ‘man awk’ and search for ‘Built-in Variables’. In this post we are going to talk about…Continue Reading →