Terminal: Mac OS X Terminal Aliases & How-To - .bash_profile / .profile
Collection of some of my fav terminal aliases that i use often & collected from the web. This file will be updated with more aliases as i find more. Feel free to comment and share your fav aliases you use :)
###Follow these simple steps to add the following aliases:###
vim ~/.bash_profile
Type i
and then paste the following at the top of the file:
alias art='php artisan'
alias st='open -a "Sublime Text 2"'
alias ..='cd ..' alias ...='cd ../../' alias ....='cd ../../../' alias .....='cd ../../../../' alias ......='cd ../../../../../'
alias dnsflush='sudo killall -HUP mDNSResponder'
alias c='clear'
alias e='exit'
alias sudo='sudo '
alias edit='SUDO_EDITOR="open -FWne" sudo -e'
alias edit_profile='open -e ~/.bash_profile'
alias edit_hosts='edit /etc/hosts' alias edit_httpd='edit /etc/apache2/httpd.conf' alias edit_php='edit /etc/php.ini' alias edit_vhosts='edit /etc/apache2/extra/httpd-vhosts.conf'
alias goto_web='cd ~/Sites' alias goto_phpext='sudo open /usr/lib/php/extensions/no-debug-non-zts-20100525'
alias goto_htdocs='cd /Applications/MAMP/htdocs'
alias killDS='find . -name *.DS_Store -type f -delete'
alias mysql='/usr/local/mysql-5.5.25-osx10.6-x86_64/bin/mysql -u root'
alias reload_profile='. ~/.bash_profile'
alias poweroff='sudo /sbin/shutdown -h now'
alias ls='ls -aFhlG' alias ll='ls -l' alias search=grep alias ports='sudo lsof -iTCP -sTCP:LISTEN -P'
alias ss='sudo /Applications/Skype.app/Contents/MacOS/Skype /secondary'
alias update="sudo softwareupdate -i -a; brew update; brew upgrade"
alias speedup="sudo rm -rf /private/var/log/asl/*"
alias emptytrash="sudo rm -rfv /Volumes/*/.Trashes; sudo rm -rfv ~/.Trash; speedup"
alias myip='curl icanhazip.com'
alias ip="dig +short myip.opendns.com @resolver1.opendns.com" alias localip="ifconfig en0 inet | grep 'inet ' | awk ' { print $2 } '" alias ips="ifconfig -a | perl -nle'/(\d+.\d+.\d+.\d+)/ && print $1'"
alias whois="whois -h whois-servers.net"
alias finder_s='defaults write com.apple.Finder AppleShowAllFiles TRUE; killAll Finder'
alias finder_h='defaults write com.apple.Finder AppleShowAllFiles FALSE; killAll Finder'
Hit ESC
, Type :wq
, and hit Enter
Reload the bash profile, In Terminal, run:
source ~/.bash_profile
And we're done! If everything went good, you should be able to start using those aliases right away :)