Professional Documents
Culture Documents
Bash Profile
Bash Profile
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
# 6. Networking
# 7. System Operations & Information
# 8. Web Development
# 9. Reminders & Notes
#
# ---------------------------------------------------------------------------
# -------------------------------
# 1. ENVIRONMENT CONFIGURATION
# -------------------------------
# Change Prompt
# ------------------------------------------------------------
export
PS1="______________________________________________________________________________
__\n| \w @ \h (\u) \n| => "
export PS2="| => "
# Set Paths
# ------------------------------------------------------------
export PATH="$PATH:/usr/local/bin/"
export
PATH="/usr/local/git/bin:/sw/bin/:/usr/local/bin:/usr/local/:/usr/local/sbin:/usr/l
ocal/mysql/bin:$PATH"
# -----------------------------
# 2. MAKE TERMINAL BETTER
# -----------------------------
# mans: Search manpage given in agument '1' for term given in argument '2'
(case insensitive)
# displays paginated result with colored search terms and two lines
surrounding each hit. Example: mans mplayer codec
# --------------------------------------------------------------------
mans () {
man $1 | grep -iC2 --color=always $2 | less
}
# -------------------------------
# 3. FILE AND FOLDER MANAGEMENT
# -------------------------------
zipf () { zip -r "$1".zip "$1" ; } # zipf: To create a ZIP archive
of a folder
alias numFiles='echo $(ls -1 | wc -l)' # numFiles: Count of non-hidden
files in current dir
alias make1mb='mkfile 1m ./1MB.dat' # make1mb: Creates a file of 1mb
size (all zeros)
alias make5mb='mkfile 5m ./5MB.dat' # make5mb: Creates a file of 5mb
size (all zeros)
alias make10mb='mkfile 10m ./10MB.dat' # make10mb: Creates a file of 10mb
size (all zeros)
# ---------------------------
# 4. SEARCHING
# ---------------------------
# ---------------------------
# 5. PROCESS MANAGEMENT
# ---------------------------
# ---------------------------
# 6. NETWORKING
# ---------------------------
# ---------------------------------------
# 7. SYSTEMS OPERATIONS & INFORMATION
# ---------------------------------------
# ---------------------------------------
# 8. WEB DEVELOPMENT
# ---------------------------------------
# httpDebug: Download a web page and show info on what took time
# -------------------------------------------------------------------
httpDebug () { /usr/bin/curl $@ -o /dev/null -w "dns: %{time_namelookup}
connect: %{time_connect} pretransfer: %{time_pretransfer} starttransfer: %
{time_starttransfer} total: %{time_total}\n" ; }
# ---------------------------------------
# 9. REMINDERS & NOTES
# ---------------------------------------