Last active
January 15, 2019 11:39
-
-
Save gilbitron/06f7d47db3002eb1e66e to your computer and use it in GitHub Desktop.
Mac OS X Bash Profile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if [ -f ~/.bashrc ]; then | |
source ~/.bashrc | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# PHP | |
export PATH="/Applications/MAMP/bin/php/php5.5.23/bin:$PATH" | |
# MySQL | |
export PATH="/Applications/MAMP/Library/bin:$PATH" | |
# Composer | |
export PATH="~/.composer/vendor/bin:$PATH" | |
# Added by the Heroku Toolbelt | |
export PATH="/usr/local/heroku/bin:$PATH" | |
# ------- | |
# Aliases | |
# ------- | |
alias cp="cp -iv" # Preferred "cp" implementation | |
alias mv="mv -iv" # Preferred "mv" implementation | |
alias mkdir="mkdir -pv" # Preferred "mkdir" implementation | |
alias ll="ls -FGlAhp" # List all files in current directory in long list format | |
alias ldir="ls -al | grep ^d" # List all directories in current directory in long list format | |
alias cd..="cd ../" # Go back 1 directory level (for fast typers) | |
alias ..="cd ../" # Go back 1 directory level | |
alias ...="cd ../../" # Go back 2 directory levels | |
alias .3="cd ../../../" # Go back 3 directory levels | |
alias .4="cd ../../../../" # Go back 4 directory levels | |
alias .5="cd ../../../../../" # Go back 5 directory levels | |
alias .6="cd ../../../../../../" # Go back 6 directory levels | |
alias f="open ." # f: Open the current directory in Finder | |
alias ~="cd ~" # ~: Go Home | |
alias c="clear" # c: Clear terminal display | |
alias ip="curl icanhazip.com" # ip: Your public IP address | |
alias ut="uptime" # ut: Computer uptime | |
alias numfiles="echo $(ls -1 | wc -l)" # numfiles: Count of non-hidden files in current dir | |
alias edithosts="sudo nano /etc/hosts" # edithosts: Edit /etc/hosts file | |
mcd () { mkdir -p "$1" && cd "$1"; } # mcd: Makes new dir and jumps inside | |
# flushdns: Flush DNS (Yosemite) | |
alias flushdns="sudo dscacheutil -flushcache;sudo killall -HUP mDNSResponder;" | |
# 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 | |
} | |
# ii: display useful host related informaton | |
ii() { | |
echo -e "\nYou are logged on ${RED}$HOST" | |
echo -e "\nAdditionnal information:$NC " ; uname -a | |
echo -e "\n${RED}Users logged on:$NC " ; w -h | |
echo -e "\n${RED}Current date :$NC " ; date | |
echo -e "\n${RED}Machine stats :$NC " ; uptime | |
echo -e "\n${RED}Current network location :$NC " ; scselect | |
echo -e "\n${RED}Public facing IP Address :$NC " ; ip | |
} | |
# gitmd: git "merge and deploy" | |
gitmd() { | |
git checkout master | |
git merge --no-edit develop | |
git push | |
git checkout develop | |
} | |
# gruntw: run grunt and watch | |
gruntw() { | |
grunt && grunt watch | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ... | |
# If you use zsh add this to the bottom of ~/.zshrc | |
if [ -f ~/.bashrc ]; then | |
source ~/.bashrc | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What about this?