How to add a column heading with awk on Linux.

This very nice one-liner will print some information about your mounted drives on Linux and also print a column header to dress up the output. ┌──[[email protected]]─[~/Downloads] └──╼ ╼ $ df -Hla | grep "[0-9]% /" | awk -F, ‘NR==1 {print "Device","Capacity","Free","Usage","Percentage","Mount"} {gsub(/"/,""); print $1,$2,$4}’ | column -t Device Capacity Free Usage Percentage Mount dev 13G … Read more

More MySQL tips for viewing data in a database and listing the columns in a table.

In this example; we are using the old and crusty Northwind database in the latest MySQL database engine. Here I am showing the tables in the database. mysql> show tables in nw_old; +——————+ | Tables_in_nw_old | +——————+ | categories | | customers | | employees | | order_details | | orders | | products | … Read more