12 Profile Shortcuts I can’t live without
If you’re a developer on a Mac or Linux box, building in Rails using Capistrano like me you can get really tired of having to “cd” to a 25 character long directory path 10 times a day while running all your script/”whatevers” while you work. Well, here’s my list of 12 shortcuts I can’t live without.
If you’re on a Mac, you’ll need to edit your “/etc/profile” page and then type these in, so something like “$textedit /etc/profile” or “$ mate /etc/profile” (if you are using TextMate) from your Terminal window will open your system profile.
- # /directories
- alias gotoMyDir="cd /Some/Path/To/A/Frequently/Accessed_Directory"
- # Rails
- #The next shortcut only opens up the rails directories I care about using TextMate
- alias matedir="mate app config lib db public test vendor/plugins &"
- alias ss="./script/server"
- alias sc="./script/console"
- alias sg="./script/generate"
- alias sp="./script/plugin"
- #Rails Capistrano ... yes, I am using Capistrano 1.4.1 instead of 2.x
- alias capd="cap _1.4.1_ deploy"
- alias capdm="cap _1.4.1_ deploy_with_migrations"
- alias capapache="cap _1.4.1_ restart_apache"
- alias caprestart="cap _1.4.1_ restart_mongrel_cluster"
- alias capstart="cap _1.4.1_ start_mongrel_cluster"
- alias capstop="cap _1.4.1_ stop_mongrel_cluster"
Now what’s nice is that f I want to visit “my directory”, while in the terminal I just type”$ gotoMyDir”; if I need to run a capistrano “deploy_with_migrations” script (yes, I’m using 1.4.1 until a few more 2.0 updates finalize) I just type in “$ capdm” … you get the picture.
Nice indeed, and saves the keys!