# .bashrc # Source the other common definitions for f in /etc/bashrc ~/.bashrc-fedora ~/.bashrc-priv; do [ -f "${f}" ] && source "${f}" || : done # User specific aliases and functions shopt -s histappend HISTSIZE=5000 HISTCONTROL=ignoreboth # subshell to avoid triggering DEBUG. (src: http://stuff.lhunath.com/.bashrc) PROMPT_COMMAND='(history -a)' PS1='\[\033[01;34m\]\u@\h\[\033[00m\]:\[\033[01;36m\]\w\[\033[00m\]\$ ' alias mc='LESS="-RSX" mc' alias gmy="pushd ~/wrkspc/gmy >/dev/null" alias gwork="pushd ~/wrkspc/gwork >/dev/null" cdup() { local up="." for i in $(seq 1 $1); do up+="/.."; done cd "${up}" 2>/dev/null && pwd || : unset up } cdmk() { cd "$1" 2>/dev/null || { mkdir "$1"; cd "$1";} } # Jim Meyring's take on "display the programs with W and X memory" # http://lists.fedoraproject.org/pipermail/devel/2013-April/181747.html sec-wx-mem() { grep -lE '^[0-9a-f-]+ .wx' /proc/*/maps 2>/dev/null \ | perl -ne 'm!^(/proc/(\d+))/.*! and printf qq(%5d %s\n), $2, `cat $1/cmdline`' \ | tr '\0' ' ' }