Collection of helpful alias methods
There was a blog post recently by the guys/gals at Thoughtbot which showed several irb & script/console tips to make development easier. I’ve been using them, and the SQL in script/console alone is worth the few minutes of setup. But I went ahead and created some more alias’s in my .profile file, which I thought some of you might like or already have. They make development just a little bit faster.
# LS
alias ls=”ls -G”
alias la=”ls -la”
# RM (to rm -rf)
alias rm=”rm -rf”
# APACHE2
alias apache_stop=’sudo apachectl stop’
alias apache_start=’sudo apachectl start’
alias apache_restart=’apache_stop && apache_start’
alias ra=’apache_restart’
# MYSQL
alias mysql_stop=’sudo launchctl stop org.macports.mysql5’
alias mysql_start=’sudo launchctl stop org.macports.mysql5’
alias mysql_restart=’mysql_stop && mysql_start’
# APACHE SITES
alias hosts=’mate /etc/hosts’
alias hosts_users=’mate /private/etc/apache2/users/rails.conf’
alias hosts_passenger=’mate /private/etc/apache2/extra/passenger.conf’
# PASSENGER SITES
alias rr=’touch tmp/restart.txt’
alias show_logs=’cd /private/var/log/apache2/ && ls -la’
alias clear_logs=’sudo rm -rf /private/var/log/apache2/*_log && sudo rm -rf /private/var/log/apache2/*.log && apache_restart’
# RAILS APPLICATIONS
alias sc=’script/console’
alias ss=’script/server’
alias bgrb_stop=’script/backgroundrb stop’
alias bgrb_start=’script/backgroundrb start’
alias bgrb_restart=’bgrb_stop && bgrb_start’
# APPLICATION TESTING
alias test_all=’rake test’
alias test_units=’rake test:units’
alias test_functionals=’rake test:functionals’
alias test_integration=’rake test:integration’
What other tips / tricks do you have? Got a killer alias? Please post in the comments.