Skip to content

Instantly share code, notes, and snippets.

@frankstallone
Last active August 29, 2015 14:16
Show Gist options
  • Save frankstallone/621758a511b8120abfdb to your computer and use it in GitHub Desktop.
Save frankstallone/621758a511b8120abfdb to your computer and use it in GitHub Desktop.
Standard Bash FTW
# Fire up Terminal! Yeehaw!
today=$(date +"%m-%d-%Y")
time=$(date +"%H:%M:%S")
freespace=$(df -h / | grep -E "\/$" | awk '{print $4}')
printf -v d "Current User:\t%s\nDate:\t\t%s @ %s\nFreespace:\t%s\n" $USER $today $time $freespace
echo "$d"
# History Settings
export HISTTIMEFORMAT='%b %d %I :%M %p ' # using strftime format
export HISTCONTRL=ignoreboth # ignoredups:ignorespace
export HISTIGNORE="history:h:pwd:exit:df:ls:ls -lha:ll"
# Making Bash Simple
PS1="\W >"
# Making it easier
alias ll='ls -lhaG'
alias home='cd ~'
# alias up='cd ..' # Using it above
alias h='history'
# Idiot Proofing
alias mv='mv -i'
alias cp='cp -i'
alias rm='rm -i'
alias df='df -h'
alias du='du -h'
alias mkdir='mkdir -p'
# Text color variables
txtund=$(tput sgr 0 1) # Underline
txtbld=$(tput bold) # Bold
txtred=$(tput setaf 1) # Red
txtgrn=$(tput setaf 2) # Green
txtylw=$(tput setaf 3) # Yellow
txtblu=$(tput setaf 4) # Blue
txtpur=$(tput setaf 5) # Purple
txtcyn=$(tput setaf 6) # Cyan
txtwht=$(tput setaf 7) # White
txtrst=$(tput sgr0) # Text reset
# Increase memory for Grunt @ https://github.com/gruntjs/grunt-contrib-watch#how-do-i-fix-the-error-emfile-too-many-opened-files
ulimit -n 1024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment