User Tools

Site Tools


bash_profile

.bash_profile

.bash_profile
#~/.bash_profile
#
#
# Set our time-zone, otherwise we get UTC and have to think;
export TZ="America/New_York"
 
# Set defaults for the history stuff big and per machine.
# This is important because HOMEDIR is an nfs mount through 
#  autofs across most  machines. 
# Below doesn't change how the time is stored in the history
#  file, only what it looks like with the history command.
HISTTIMEFORMAT="%F %H:%M "
HISTSIZE=11000
HISTDIR=${HOME}/.history
mkdir -p ${HISTDIR}  # Should exist, but just to be certain.
HISTFILE=${HISTDIR}/${HOSTNAME}_history
 
# And a thing to make and save logs, use like;
# <some program> | LOG
# Output goes to screen and log.
LOGFILE=${HISTDIR}/${HOSTNAME}_log
LOG () {
        tee -a ${LOGFILE}
}
 
# Below shows ansi colors in log files.
alias less='less -r'
 
# If we're on the home machine, syncronize with OneDrive.
if [ "${HOSTNAME}" == "PersonalBox" ] ; then
        onedrive --synchronize
 
# And, if we're on the home machine, run ~/.sshrc
        if [ -e ~/.sshrc ]
        then . ~/.sshrc
        fi
fi
 
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi
 
alias ls='ls --color=auto --time-style="+%Y-%m-%d %H:%M:%S"'
alias ll='ls -l'
alias l='ls -altr'
alias l.='ls -d .*'
alias R='cat /etc/*ease | grep PRETTY | cut -d "=" -f 2'
alias D='lsblk -i -f -o size,fstype,name,mountpoint,uuid'
alias I='ip a | grep -E "inet|inet6"'
alias F='df -lBM --output=source,iavail,avail,target -h'
 
# And, if you want the weather;
alias W='curl wttr.in'
 
cat /etc/*ease | grep PRETTY | cut -d "=" -f 2
 
# ~/bin is usually a link to a shared bin folder.
if [ -d ~/bin ]
then
        PATH="~/bin:${PATH}"
fi
 
# ~/.local/bin is per-machine
if [ -d ~/.local/bin ]
then
        PATH="~/.local/bin:${PATH}"
fi
 
# For a multi-line prompt that can easily be copied and pasted;
export PS1="
# \u in \w on \h at \D{%Y-%m-%d-%H-%M} #
"
 
# vim:ts=4:sw=4
bash_profile.txt · Last modified: by steve