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
export EDITOR="nano"
# Aliases
alias c='clear'
alias ll="ls -la ${colorflag}"
alias apup="sudo service apache2 restart"
alias plexup="sudo service plexmediaserver restart"
alias aptup="sudo apt-get update && sudo apt-get upgrade -y"
alias bpup="source ~/.bash_profile"
alias install="sudo apt-get install"
alias ax='chmod a+x'
alias yt="youtube-dl --add-metadata -f mp4 -o '%(title)s [%(id)s].%(ext)s'"
alias ytclips="youtube-dl --add-metadata -f mp4 -o '/mnt/media/Clips/%(title)s [%(id)s].%(ext)s'"
alias ytmusic="youtube-dl --add-metadata -f mp4 -o '/mnt/media/Music Videos/%(title)s [%(id)s].%(ext)s'"
alias ytplaylist="youtube-dl --add-metadata -f mp4 -o '/mnt/media/YouTube Series/%(playlist_title)s/%(playlist_index)s - %(title)s [%(id)s].%(ext)s'"
alias gist="gist-paste"
alias gistbp="gist -u ~/.bash_profile"
## 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
alias ip='curl'
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