Linux, UNIX or MacOS -SIMPLE- .bashrc:
# .bashrc
#########################################################
### .bashrc file - updated 10 june 2016
#########################################################
export PS1="
------------------------------------------------
$(whoami)@`hostname` [\$PWD]
------------------------------------------------
--> "
#########################################################
# alternate PS1 using only 2 lines:
# export PS1='\u@\h [\w]\n--> '
#########################################################
if [ ! -d /home/$(whoami)/.History ]
then
/usr/bin/mkdir /home/$(whoami)/.History
/usr/bin/echo "history directory made"
fi
###########################################
export HISTFILE="/home/$(whoami)/.History/`/bin/date '+%d%b%y_%H%M'.history`"
export HISTSIZE=1024
###########################################
shopt -s histverify # enables recall of history line with !number for edit
###########################################
export EDITOR=/usr/bin/vi; export VISUAL=/usr/bin/vi # very important - LEARN vi!
###########################################
set -o vi # allows the use of the vi editor on the command line
###########################################
PATH="$PATH:/home/$(whoami)/bin:/usr/sbin:/sbin"
###########################################
alias ll="/usr/bin/ls -Al"
alias mv="/usr/bin/mv -i" # recommended as a safety net, there are no undo's in Linux
alias cp="/usr/bin/cp -i" # recommended as a safety net, there are no undo's in Linux
alias rm="/usr/bin/rm -i" # recommended as a safety net, there are no undo's in Linux
alias dfh='df -h | grep -v tmpfs | grep -v none | grep -v udev' # varies based on distro and whether systemd or initd
alias mroe=more # just in case you type too fast... add others like this
##########################################
#NOTES: check paths of commands using "which", e.g. which hostname;
# If .bashrc fails to source, make .profile with: . ./.bashrc
##########
# for Solaris 10, replace: $(whoami) with: `/usr/ucb/whoami`
##########
# john - 23 sep 2015 http://johnmeister.com/linux/Notes/bashrc-simple.html
# john - 16 may 2016 updated to use $(whoami) to define /home/(user)/.History
# john - 10 jun 2016 added shopt -s histverify to permit "!number" from history for edit using vi
##########
|
|
![]() Wagoneers FULL SIZE JEEPS JeepMeister "Jeep is America's -Enzo Ferrari MeisterTech Diesels + |
One Page Overview of Linux Commands click for an image of the 5 essential Linux commands An Intro to Linux |
at Midway Auto on SR9 in Snohomish, or at Northland Diesel in Bellingham, WA |