# Merge Multiple Files With Header Rows

AWK / BASH one-liner to merge multiple files skipping the first row of each file except the first file, skipping blank lines (useful for concatenating table/data files where the first row is a header): awk 'NF==0 || (FNR==1 && NR!=1){next;}{print}' file1.txt file2.txt .

# Bash Script Automatic Exit on Command Failure

Stick this at the top of your multi-command BASH job scripts: set -e -o pipefail Exits on failure (== non-0 return code from any commands in the script) instead of cheerfully executing all subsequent lines in what is bound to result in a cascade of errors (or worse). More information in the excellent post here.

# Neat Bash Trick: Open Last Command for Editing in the Default Editor and then Execute on Saving/Exiting

This is pretty slick: enter “fc” in the shell and your last command opens up for editing in your default editor (as given by “\$EDITOR”). Works perfectly with vi. With vi, “:cq” aborts execution of the command.