################################## john's .bashrc 28 Dec 2017 ###################
# the .bashrc file sets useful user configurations related to:
# Path, Prompt, Permissions, History, Editor, Alias, Shell options and Functions
# http://johnmeister.com/linux/bashrc-basic.html
###################################################################################
# PATH:
## from /etc/login.defs: ## *REQUIRED* The default PATH settings, for superuser and normal users.
## NO NEED TO ADD THE PATHS FOUND in ENV_PATH which are: PATH=/usr/local/bin:/usr/bin:/bin
## ENV_SUPATH PATH=/sbin:/bin:/usr/sbin:/usr/bin #
# FOR BASIC USER:
export PATH=$PATH:~/bin:/sbin:/usr/sbin:~:.
# recommended only for more ADVANCED users:
# export PATH=$PATH:~/bin:/sbin:/usr/sbin:/usr/local/sbin:~:.
#======================================================================================
# PROMPT:
export PS1="
------------------------------------------------
$(whoami)@`hostname` [\$PWD]
------------------------------------------------
--> "
#======================================================================================
# PERMISSIONS:
umask 022
# note: umask 022 sets new files: 644 & dirs: 755
#======================================================================================
# HISTORY:
# if [ ! -d ~/.History ]
# note: tests for directory, if not, then...
# then
# mkdir ~/.History
# echo "history directory made"
# fi
#======================================================================================
# note: creates a history file for each instance e.g.: 2017_10_Oct_01_1515.history
#======================================================================================
#### NOTE: insert your full user path in place of the "tilda" to ensure it works ####
HISTFILE="~/.History/`/bin/date '+%Y_%m_%b_%d_%H:%M'.history`" ; export HISTFILE
# echo $HISTFILE
HISTSIZE=2048; export HISTSIZE # default is usually 1024, acceptable
#======================================================================================
# note: on MacOSx, block appendable history: SHELL_SESSION_HISTORY=0
#======================================================================================
# EDITOR:
set -o vi
#======================================================================================
# note: using set -o vi allows recall of commands via vi commands and inline editing
#======================================================================================
# note: verify location by typing: which vi (often systems will link /bin to /usr/bin
#======================================================================================
### if you only have vi - change this... also check path to vi or vim: which vi ###
EDITOR=/usr/bin/vim; export EDITOR
VISUAL=/usr/bin/vim; export VISUAL
#======================================================================================
# note optional aliases - use to create simple commands or alternate OS commands
#======================================================================================
### check the path of commands - if not desired put a pound sign(#) in front of the line ###
# 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 files, use full path or \ to override
alias cp="/bin/cp -i" # -i prevents overwriting files, use full path to override
alias rm="rm -i" # -i prevents overwriting files, use full path to override
alias dfh='df -hT | 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
alias list-functions="grep function ~/.bashrc"
#=======================================================================================
# SHELL OPTIONS:
shopt -s histverify # allows recall historical commands, edit, then use, type: history
shopt -s checkwinsize
#==========================================================================================
### NOTE: you can place the Bible text files in any directory you'd like, adjust below ###
######################
# FUNCTIONS:
# creates a directory structure and changes to the lowest level - be aware of keywords
function dir-mkcd () { mkdir -p "$@" && eval cd "\"\$$#\""; }
#
# functions - ###############################################################################
function ge () { grep -i "$*" ~/BIBLES/ENG.txt;} ## NAS-NKJV-KJV
function gef () { grep -i "$*" ~/BIBLES/ENG.txt |fold -s -w 80;} ## NAS-NKJV-KJV - folded
function ge4 () { grep -i "$*" ~/BIBLES/ENG4.txt;} ## NAS-NKJV-KJV-YLT
# functions - ###############################################################################
# functions - ### INDIVIDUAL translations: NAS, KJV, NKJV, YLT ######
function gn () { grep -i "$*" ~/BIBLES/NAS.txt;} ## NAS - New American Std
function gk () { grep -i "$*" ~/BIBLES/KJV.txt;} ## KJV - KJV
function gw () { grep -i "$*" ~/BIBLES/NKJV.txt;} ## NKJV - New KJV
function gy () { grep -i "$*" ~/BIBLES/YLT.txt;} ## YLT - Youngs Literal
# functions - ###############################################################################
# functions - ### NAS folded or wider context ######
function gnf () { grep -i "$*" ~/BIBLES/NAS.txt | fold -s -w 80;} ## NAS 80 columns
function gnf100 () { grep -i "$*" ~/BIBLES/NAS.txt | fold -s -w 100;} ## NAS 100 columns
function gnf120 () { grep -i "$*" ~/BIBLES/NAS.txt | fold -s -w 120;} ## NAS 120 columns
function gn2 () { grep -C 2 -i "$*" ~/BIBLES/NAS.txt;} ## NAS context 2 lines
function gn3 () { grep -C 3 -i "$*" ~/BIBLES/NAS.txt;} ## NAS context 3 lines
function gn4 () { grep -C 4 -i "$*" ~/BIBLES/NAS.txt;} ## NAS context 4 lines
function gn5 () { grep -C 5 -i "$*" ~/BIBLES/NAS.txt;} ## NAS context 5 lines
# functions - ###############################################################################
# functions - ### NAS and German ###
function gnd () { grep -A 1 -i "$*" ~/BIBLES/ND.txt;} ## NAS and German
# functions - #################################################
# functions - ### translations with NAS - nkjv, kjv, ylt, dhs and greek #####################
function gsix () { grep -A 3 -B1 -i "$*" ~/BIBLES/SIX.txt;} ## NAS,NKJV,KJV,YLT,DHS,Greek
function g6 () { grep -A 3 -B1 -i "$*" ~/BIBLES/SIX.txt;} ## NAS,NKJV,KJV,YLT,DHS,Greek
# functions - #################################################
# functions - ### NAS, NKJV, KJV, DHS, GREEK ###############################################
function gz () { grep -A 4 -B 2 -i "$*" ~/BIBLES/NkKDG.txt;} ## NAS,NKJV,KJV,DHS,Greek
function ga () { grep -A 3 -B 1 -i "$*" ~/BIBLES/NKDG.txt;} ## KJV,NAS,DHS,Greek
function gkn () { grep -C 1 -i "$*" ~/BIBLES/KNb.txt;} ## KJV-NAS
function gnd3 () { grep -A 5 -B 4 -i "$*" ~/BIBLES/ND.txt;} ## NAS and DHS context 3
function gz-nas-uncited () { grep -A 4 -B 2 -i "$*" ~/BIBLES/ANODG.txt;} ## NAS,NKJV,KJV,DHS,Greek
# functions - #####################################################################################
# functions - KJV ### context and MULTIPLE translations with KJV ######
function gk3 () { grep -C 3 -i "$*" ~/BIBLES/KJV.txt;} ## KJV context 3 lines
function gknd () { grep -C 3 -i "$*" ~/BIBLES/KND.txt;} ## KJV,NAS,DHS context 3
function gknn () { grep -A 2 -B2 -i "$*" ~/BIBLES/KNN.txt;} ## KJV,NKJV,NAS
# functions - ########################################################################################
# functions - ### NAS, NKJV, KJV, DHS, GREEK #######################################################
function ganodg () { grep -A 8 -B 3 -i "$*" ~/BIBLES/ANODG.txt;} ## NAS,NKJV,KJV,DHS,Greek
function ganodgl () { grep -A 4 -B 3 -i "$*" ~/BIBLES/ANODG.txt;} ## NAS,NKJV,KJV,DHS,Greek
function gnn () { grep -C 1 -i "$*" ~/BIBLES/NN.txt;} ## NAS-NKJV - lines
function gnl () { grep -C 1 -i "$*" ~/BIBLES/NNn.txt;} ## NAS-NKJV - no lines
function gnnk () { grep -A 2 -B2 -i "$*" ~/BIBLES/NNK.txt;} ## NAS,NKJV,KJV
function g3 () { grep -A 2 -B2 -i "$*" ~/BIBLES/NNK.txt;} ## NAS,NKJV,KJV
function g4 () { grep -A 2 -B2 -i "$*" ~/BIBLES/NkKD.txt;} ## NAS,NKJV,KJV,DHS
function g5 () { grep -A 1 -B1 -i "$*" ~/BIBLES/ANODG.txt;} ## NAS-not-cited,NKJV,KJV,DHS,Greek
function g5c () { grep -A 2 -B2 -i "$*" ~/BIBLES/NkKDG.txt;} ## NAS-cited,NKJV,KJV,DHS,Greek
# functions - ########################################################################################
#==========================================================================================
# ADDITIONAL NOTES - for user configuration
# 1) setup: .exrc (configuratin file for the vi editor - ex is an editor within vi)
# set tabstop=4 shiftwidth=4 expandtab
# syntax off
# set ruler
# -----------------------------------
# tabstops - determines how many spaces per tab (normal is 5)
# shiftwidth - determines shift width, on type writers there were tabs, and tabstops, manually set
# rule - provides digital count of lines and spaces in lower right - very useful!
# -------
# norule - (: set norule ) turns off lines, characters and page %
# number - (: set nu) puts line numbers on left (not included in print or file save)
# nonumber - (: set nonu )
# -----------------------------------
# 2) FIVE BASIC COMMANDS:
# 1) man (also: --help, e.g. man --help )
# 2) ls (also: ls -al and ls -Al) (note: 26 letters, upper and lower case)
# 3) cd (type: which cd ) (NOTE: this is not a command, but a shell built-in)
# 4) pwd (print working director)
# 5) more (more is recommened, but less is more, both better than cat, because...)
# -----------------------------------
# 3) configure .ssh if using more than one Linux or MacOSX system
# see http://johnmeister.com/linux/Notes/SSH/quick-ssh.html
# mkdir .ssh ; cd .ssh ; ssh-keygen ; cp id_rsa.pub id_rsa.HOSTNAME
# -----------------------------------
# 4) some useful commands:
# 1) When copying a file, append the date: cp FILE FILE-`date +'%Y-%m-%b-%d'`
# 2) Use rsync to completely replace a local directory with that from another system as a backup
# use trailing "/" to prevent creating a new directory structure, and only use --delete if you want
# to remove old files locally. This is a very dangerous command - useful if you use more than one system
# rsync -av --delete --progress :/home/luser/somedir/ /home/luser/localdir/
# e.g.# rsync -av --delete --progress 192.168.11.99:/home/luser/files/ /home/luser/files/
#==========================================================================================
JohnMeister.com Today's Date:
|
![]() SJ - 1962-1991 |
![]() XJ - 1984-2001 |
![]() WJ - 1999-2004 |
![]() KJ - 2002-2007 |
WK - 2005-2010 |
Find the recommended AMSOIL synthetics for your Jeep |
![]() CJ-10A - 1984-1986 |
![]() Jeepsters |
![]() MJ - 1984-1992 |
![]() Willys - 1946-1965 |
![]() Other Jeeps (FC) |