# to source, type: . ~/.bashrc or from home dir: . ./.bashrc # adjusted for Win10 BASH - 19 July 2017 - works for all Unix-like shells - check paths #========================================================================================= # setup: Path, Prompt, Permissions, History, Editor, Alias, Shell options and Functions #========================================================================================= # do NOT use ~(tilde) .(period) for root user. To overwrite default PATH, remove $PATH # W10 BASH DEFAULT=($PATH): /usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games export PATH=$PATH:/sbin/:/usr/sbin:/usr/local/sbin:/etc:~/bin:~:. #========================================================================================= # useful prompt to provide clean view of shell and results #========================================================================================= export PS1=" ------------------------------------------------ $(whoami)@`hostname` [\$PWD] ------------------------------------------------ --> " #====================================================================================== umask 022 # umask 022 sets new files: 644 & dirs: 755 #====================================================================================== if [ ! -d ~/.History ] # tests for directory, if not, then... then /bin/mkdir ~/.History /bin/echo "history directory made" fi # sets up individual history files for each instance of the shell, VERY useful HISTFILE="~/.History/`/bin/date '+%Y_%b_%d_%H:%M'.history`" ; export HISTFILE HISTSIZE=2048; export HISTSIZE # default is usually 1024, acceptable #====================================================================================== EDITOR=/usr/bin/vi; export EDITOR # verify location by typing: which vi VISUAL=/usr/bin/vi; export VISUAL set -o vi # allows recall of commands via vi commands and inline editing #====================================================================================== # optional aliases - use to create simple commands or alternate OS commands 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 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='/bin/df -h | /usr/bin/grep disk' # modify to show primary file systems alias vi="/usr/bin/vim" # type which vi or which vim, set accordingly alias mroe=more # add any other words you mistype often #======================================================================================= # SHELL OPTIONS shopt -s histverify # allows recall historical commands, edit, then use, type: history shopt -s checkwinsize #========================================================================================== # creates a directory structure and changes to the lowest level - be aware of keywords function dir-mkcd () { mkdir -p "$@" && eval cd "\"\$$#\""; } ########################################################################################### # .exrc settings for vi, create .exrc and/or execute by typing |
|
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 |