alias cd..='cd ..'
alias cdc='cd ..'
alias ll='ls'
alias lll='ls -l'
alias ls='ls --color=auto'
alias nan='nano -BSc'
alias s='sudo'
alias snan='sudo nano -BSc'
alias svi='s vim'
alias hl='history|less'
alias h='host'


t80()
{
telnet $1 80
}

t443()
{
telnet $1 443
}

hg()
{
history|grep $1
}

sre()
{
sudo /etc/init.d/$1 reload
}

ssa()
{
sudo /etc/init.d/$1 start
}

sso()
{
sudo /etc/init.d/$1 stop
}

faccyear()
{
ls -Rlua $1|grep -v '\\.$'|grep `date "+%Y"`
}

scpnewestfile()
{
scp `ls -ltr|tail -1|tr -s ' '|cut -d ' ' -f8` $1
}

alias ..='cd ..'
alias d='ls -l | grep -E "^d"'


alias less='less -P "?f%f .?m(file %i of %m) .?ltlines %lt-%lb?L/%L. . byte %bB?s/%s. ?e(END) :?pB%pB\\%..%t"'

export HISTIGNORE="&:[ ]*:exit"

trap 'archive_history' EXIT
export CURBASHSTART=`grep -v "^[ \    ]*$" $HISTFILE | wc -l | awk '{print $1}'`  CURBASHDATE=`date`
shopt -s cmdhist histappend
archive_history()
{
    HISTORYOLD=${HISTFILE}.archive
    CURTIME=`date`
    CURTTY=`tty`
    if  [ x$HISTDUMPPED = x ]; then
      echo "#-${HOSTNAME}-- ${CURBASHDATE} - ${CURTIME} ($CURTTY) ----" >>   $HISTORYOLD
      history $(($HISTCMD-${CURBASHSTART-0})) | sed -e 's/^[ ]*[0-9][0-9]* [ ]*//g'  >> $HISTORYOLD
      export HISTDUMPPED=1
    fi
}

exit ()
{
   archive_history
   builtin exit
}

fif () 
{ 
    find . -type f -exec grep -li $1 {} \\;
}