Skip to content

Instantly share code, notes, and snippets.

@orhanveli
Created October 3, 2015 11:31
Show Gist options
  • Select an option

  • Save orhanveli/eaa909075e4f2574b6d7 to your computer and use it in GitHub Desktop.

Select an option

Save orhanveli/eaa909075e4f2574b6d7 to your computer and use it in GitHub Desktop.
my .bash_aliases
# textedit
alias te='open /applications/textedit.app'
#
# Colors colors colors
#alias ls='ls --color=always'
alias ls='ls -G'
alias grep="grep --color=auto"
alias cls='clear'
alias hibernate="systemctl hibernate"
alias suspend="systemctl suspend"
# Sort files by Size
alias sortbysize="ls -s | sort -n"
# -------------------------------
# 3. FILE AND FOLDER MANAGEMENT
# -------------------------------
# extract: Extract most know archives with one command
# ---------------------------------------------------------
extract () {
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xjf $1 ;;
*.tar.gz) tar xzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) unrar e $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xf $1 ;;
*.tbz2) tar xjf $1 ;;
*.tgz) tar xzf $1 ;;
*.zip) unzip $1 ;;
*.Z) uncompress $1 ;;
*.7z) 7z x $1 ;;
*) echo "'$1' cannot be extracted via extract()" ;;
esac
else
echo "'$1' is not a valid file"
fi
}
# ---------------------------
# 6. NETWORKING
# ---------------------------
alias myip='curl ip.appspot.com' # myip: Public facing IP Address
alias flushdns='dscacheutil -flushcache' # flushDNS: Flush out the DNS Cache
# ---------------------------------------
# 8. WEB DEVELOPMENT
# ---------------------------------------
alias edithosts='sudo open /applications/textedit.app /etc/hosts' # edithosts: Edit /etc/hosts file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment