#==============================================================================
# VARIOUS ALIAS, shell options and FUNCTIONS - updated 12 January 2021 jm
#==============================================================================
HISTFILE="/home/luser/.History/`/bin/date '+%Y_%m_%b_%d_%H:%M'.history`"
HISTSIZE=2048; export HISTSIZE # default is usually 1024, acceptable
#==============================================================================
# ALIAS:
alias fdl="sudo fdisk -l | sed 's/^$/ --/g' | grep -E '(Device|dev|-------)'"
alias l="/bin/ls -al" ; alias ll="/bin/ls -l" # can separate commands with ;
alias lm="/bin/ls -l | more"
alias md="/bin/mkdir -p" # creates full path
alias mv="/bin/mv -i" # -i prevents overwriting, full path or \ to override
alias cp="/bin/cp -i" # -i prevents overwriting, full path or \
alias rm="rm -i" # -i prevents overwriting, full path or \
alias dfh='df -h | grep -v fs | grep -v boot | grep -v udev'
# alias dfh='/bin/df -h | /bin/grep sda' # modify to show primary file systems
alias dfa='df -h | grep sda'
alias mroe=more # add any other words you mistype often
alias cd4="cd ../../../..; ls -al"
alias cd3="cd ../../..; ls -al"
alias cd2="cd ../..; ls -al"
alias h3='head -n 3' # useful for checking files
alias h4='head -n 4' # useful for checking files
alias h5='head -n 5' # useful for checking files
alias t3='tail -n 3' # useful for checking files
alias t4='tail -n 4' # useful for checking files
alias t5='tail -n 5' # useful for checking files
#=============================================================================
# SHELL OPTIONS:
shopt -s histverify # allows recall historical commands, edit, then use
shopt -s checkwinsize
#=============================================================================
# FUNCTIONS: be aware of keywords
# creates directory structure and cd to the lowest level
function dir-mkcd () { mkdir -p "$@" && eval cd "\"\$$#\""; }
# grep functions for Bible versions - case insensitive and places quotes
function gn () { grep -i "$*" ~/BIBLES/NAS.txt;}
function gn3 () { grep -C 3 -i "$*" ~/BIBLES/NAS.txt;}
function gk () { grep -i "$*" ~/BIBLES/KJV.txt;}
function gk3 () { grep -C 3 -i "$*" ~/BIBLES/KJV.txt;}
function gb () { grep -C 1 -i "$*" ~/BIBLES/KNb.txt;}
function gg () { grep -A 1 -i "$*" ~/BIBLES/ND.txt;}
function gg3 () { grep -A 5 -B 4 -i "$*" ~/BIBLES/ND.txt;}
#==============================================================================
JohnMeister.com Today's Date:
|