Skip to content

Instantly share code, notes, and snippets.

@KristofferHebert
Last active August 29, 2015 14:02
Show Gist options
  • Save KristofferHebert/ea9eace33c8b3d0abb2f to your computer and use it in GitHub Desktop.
Save KristofferHebert/ea9eace33c8b3d0abb2f to your computer and use it in GitHub Desktop.
Custom bash commands for Terminal.
# 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
}
@KristofferHebert
Copy link
Author

prompt.sh is based on https://gist.github.com/306785.git

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment