Files Manipulation Editing Filter file for unique lines awk '!a[$0]++' file Searching Show 2 lines before and 1 after in grep echo "" | grep -B 2 -A 1 "pattern" Extract by pattern (mac) in grep echo "" | grep -Eo "regex"