Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
The bash profile used on my home Raspberry Pi server
# PATH exports
PATH=$PATH:/home/pi/bin
# Aliases
alias yt="youtube-dl -o '%(autonumber)s-%(title)s.%(ext)s' --write-thumbnail --autonumber-size 3 --add-metadata"
alias c='clear'
alias ll="ls -la ${colorflag}"
alias apup="sudo service apache2 restart"
alias plexup="sudo service plexmediaserver restart"
alias ubup="sudo /etc/init.d/ubooquity restart"
alias aptup="sudo apt-get update && sudo apt-get upgrade && sudo /usr/share/rpimonitor/scripts/updatePackagesStatus.pl"
alias install="sudo apt-get install"
alias ax='chmod a+x'
## a quick way to get out of current directory ##
alias ..='cd ..'
alias ...='cd ../../../'
alias ....='cd ../../../../'
alias .....='cd ../../../../'
alias .4='cd ../../../../'
alias .5='cd ../../../../..'
# Default Settings
alias df='df -H'
alias du='du -ch'
alias ls='ls -l --color=auto'
alias tar="tar xzvf"
# IP addresses
# http://brettterpstra.com/2013/03/31/a-few-more-of-my-favorite-shell-aliases/
alias ip='curl icanhazip.com'
alias localip='ipconfig getifaddr en1'
alias ips="ifconfig -a | perl -nle'/(\d+\.\d+\.\d+\.\d+)/ && print $1'"
# Create a new directory and enter it
function md() {
mkdir -p "$@" && cd "$@"
}
# Pi Colors
export PS1="\[\033[38;5;6m\]\u\[$(tput sgr0)\]\[\033[38;5;7m\]@\[$(tput sgr0)\]\[\033[38;5;1m\]\h\[$(tput sgr0)\]\[\033[38;5;7m\]:\[$(tput sgr0)\]\[\033[38;5;2m\][\w]\[$(tput sgr0)\]\[\033[38;5;7m\]\\$\[$(tput sgr0)\]\[\033[38;5;15m\] \[$(tput sgr0)\]"
# Search History with Up and Down
bind '"\e[A":history-search-backward'
bind '"\e[B":history-search-forward'
export PATH="/usr/local/sbin:$PATH"
# Dumb Typos
alias cd..='cd ..'
alias chomd='chmod'
alias sl='ls'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment