Skip to content

Instantly share code, notes, and snippets.

View hypermano's full-sized avatar

Emmanuel Alhadeff hypermano

View GitHub Profile
@hypermano
hypermano / aliases.sh
Last active March 22, 2017 10:17
Helpers 2.0
# Easier navigation: .., ..., ...., ....., ~ and -
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias .....="cd ../../../.."
alias ~="cd ~" # `cd` is probably faster to type though
alias -- -="cd -"
alias aws="aws --region us-east-1"
bind '"\et':\""tail -f\""
@hypermano
hypermano / awk.sh
Last active July 23, 2018 16:33
Linux Essentials
### Awk
awk 'BEGIN {print "<"} {print $1 "/" $NF } END {print ">"}' # print 1st field + total fields per line
awk '{print $1, $2}' | awk '{print $1 $2}' # concat separated vs. concat
awk '{ if ($0 ~ /regex/) { print $0 } }' # prints lines matching regex
awk 'BEGIN {FS=","}' # use comma as field separator
# Variables
# OFS - Output Field Separator
# NR - Number of Records (lines)