/etc/bash.bashrc

I am proud of my aliases

See also this thread.

# System-wide .bashrc file for interactive bash(1) shells.

# To enable the settings / commands in this file for login shells as well,
# this file has to be sourced in /etc/profile.

# If not running interactively, don't do anything
[ -z "$PS1" ] && return

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize

# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
    debian_chroot=$(cat /etc/debian_chroot)
fi

# set a fancy prompt (non-color, overwrite the one in /etc/profile)
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '

# Commented out, don't overwrite xterm -T "title" -n "icontitle" by default.
# If this is an xterm set the title to user@host:dir
#case "$TERM" in
#xterm*|rxvt*)
#    PROMPT_COMMAND='echo -ne "33]0;${USER}@${HOSTNAME}: ${PWD}07"'
#    ;;
#*)
#    ;;
#esac

# enable bash completion in interactive shells
if [ -f /etc/bash_completion ]; then
    . /etc/bash_completion
fi

# sudo hint
if [ ! -e $HOME/.sudo_as_admin_successful ]; then
    case " $(groups) " in *\ admin\ *)
    if [ -x /usr/bin/sudo ]; then
    cat <<-EOF
    To run a command as administrator (user "root"), use "sudo <command>".
    See "man sudo_root" for details.
   
    EOF
    fi
    esac
fi

# if the command-not-found package is installed, use it
if [ -x /usr/lib/command-not-found ]; then
    function command_not_found_handle {
                /usr/bin/python /usr/lib/command-not-found -- $1
                return $?
    }
fi

# EXIT:
alias grep="grep --color=auto"
alias ls='ls --color'
alias ll='ls -l'
alias l='ls -CF'
alias la='ls -A'
alias lla='ll -A'
alias dir='ls -ba'
alias lh='ll -h'

alias dh='df -h'
alias dhh='dh ~ / /media/big/'
alias md='mkdir'
alias c='clear'
alias p='pstree -pl'
alias j='jobs'
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias e='editor'
alias v='view'
alias m='less -i'
alias a='cat'
alias h='history 30'
alias hh='history'

alias gh='history |grep ' # arg
alias ii='dpkg -l |grep -i' # arg
alias ir='ps aux |head -n 1 && ps aux |grep -i $1' # this one outputs some garbage at the end.
                                                   # can't find an easy way to avoid it.
# not as harmless as they look!
# alias rm='rm -i'
# alias cp='cp -i'
# alias mv='mv -i'

alias rmi='rm -i'
alias cpi='cp -i'
alias mvi='mv -i'

alias rmprog='rm -vf *.o *.e *.bak *~ *.out *.class *.gcov *.gcda *.gcno'

# alias xwpe='xwpe -font 9x15'
# when I used to use xwpe
# alias hibernate='kdesktop_lock --forcelock &  sudo hibernate'
# when I used to use swsusp2

alias push='pushd .'
alias pop='popd'
# any ideas for better names?

alias tpush='rm -f /tmp/pushed_pwd && pwd >/tmp/pushed_pwd && chmod a+rw /tmp/pushed_pwd'
alias tpop='cd "$(cat /tmp/pushed_pwd)"'

alias smbx='sudo mount -t smbfs -o username=exit //desktop/x$ /media/samba/'
alias unsmbx='sudo umount /media/samba/'

alias ase='apt-cache search'
alias ash='apt-cache show'

set -o noclobber

HISTSIZE=10000
HISTFILESIZE=10000

alias calc='bc -ql'
alias lg='lsof -n |grep -i ' # arg
alias ko='kfmclient openURL'
alias whatip='w3m -dump whatismyip.org'

LOGGED_IN_AT=$(date)
echo "Logged in at $LOGGED_IN_AT"

# /EXIT:

Comments are closed.

%d bloggers like this: