Last active
August 29, 2015 14:02
-
-
Save KristofferHebert/ea9eace33c8b3d0abb2f to your computer and use it in GitHub Desktop.
Custom bash commands for Terminal.
This file contains hidden or 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
| # load z script | |
| . /usr/local/bin/z.sh | |
| # load sexy prompt | |
| . /usr/local/bin/prompt.sh | |
| # shorthand for change to parent folder | |
| .. (){ | |
| cd .. | |
| } | |
| # change directory to Sites folder | |
| sites (){ | |
| cd /Users/$USER/Sites | |
| } | |
| # change directory to Desktop folder | |
| desktop (){ | |
| cd /Users/$USER/Desktop | |
| } | |
| # change directory to htdocs for XAMPP | |
| htdocs(){ | |
| cd /Applications/XAMPP/xamppfiles/htdocs | |
| } | |
| # create file and open file | |
| tap(){ | |
| touch $1 && open $1 | |
| } | |
| # create folder and change directory into folder | |
| mk(){ | |
| mkdir $1 && cd $1 | |
| } | |
| # open in Firefox | |
| firefox(){ | |
| open $1 -a Firefox | |
| } | |
| # open in Chrome | |
| chrome(){ | |
| open $1 -a 'Google Chrome' | |
| } | |
| # open in Safari | |
| safari(){ | |
| open $1 -a Safari | |
| } | |
| # open in Sublime | |
| sublime(){ | |
| open $1 -a "Sublime Text" | |
| } | |
| # open file in all browsers | |
| testall() { | |
| firefox $1; chrome $1; safari $1; | |
| } | |
| # shorthand for git status | |
| gs() { | |
| git status | |
| } | |
| # shorthand for git status | |
| gd() { | |
| git diff | |
| } | |
| # shortcut for http-server | |
| server(){ | |
| http-server | |
| } | |
| # open bash_profile file | |
| bash-profile() { | |
| open /Users/$USER/.bash_profile | |
| } | |
| # reload bash-profile file | |
| r-bash-profile() { | |
| . /Users/$USER/.bash_profile | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
prompt.sh is based on https://gist.github.com/306785.git