a simple .bashrcexport PS1=" ------------------------------------------------ $(whoami)@`hostname` [\$PWD] ------------------------------------------------ --> " EDITOR=/usr/bin/vi; export EDITOR ; VISUAL=/usr/bin/vi; export VISUAL export HISTFILE="/home/luser/.History/`/bin/date '+%d%b%y_%H%M'.hstry.txt`" set -o vi PATH="$PATH:/home/luser/bin:/usr/sbin:/sbin" alias ll="/bin/ls -Al" alias mv="/bin/mv -i" alias cp="/bin/cp -i" alias rm="rm -i" the prompt - PS1export PS1=" ------------------------------------------------ $(whoami)@`hostname` [\$PWD] ------------------------------------------------ --> "
the history file, written to .Historyexport HISTFILE="/home/luser/.History/`/usr/bin/date '+%d%b%y_%H%M'.hstry.txt`"
the editorEDITOR=/usr/bin/vi; export EDITOR ; export VISUAL=/usr/bin/vi Note that more than one variable may be defined per line, separated by a ";" You can export the variable as you declare it, or later. Bash will invoke an editor on the current command line, and execute the result as shell commands. Bash attempts to invoke $VISUAL, $EDITOR, and emacs as the editor, in that order. (from "man bash | col -b | grep -C 5 VISUAL" ) A sysadmin should only use vi, it is always on all UNIX and Linux systems Other editors such as emacs, nano, and pico may not be installed or work The use of vi at the command line provides for rapid command editing the set optionsset -o vi # allows the use of the vi editor on the command line The set command can be executed at the command line or in the .bashrc --> set -o ( taken from a SuSE system, shown with ";" for clarity ) allexport off; braceexpand on; emacs off; errexit off; errtrace off; functrace off; hashall on; histexpand on; history on; ignoreeof off; interactive-comments on; keyword off; monitor on; noclobber off; noexec off; noglob off; nolog off; notify off; nounset off; onecmd off; physical off; pipefail off; posix off; privileged off; verbose off; vi on; xtrace off; the PATHPATH="$PATH:/home/USER/bin:/usr/sbin:/sbin" --> env | grep PATH MANPATH=/usr/local/man:/usr/share/man XNLSPATH=/usr/share/X11/nls PATH=/home/john/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin: /usr/games:/bin:/sbin/:/usr/sbin:/etc:/usr/local/sbin:. ALSA_CONFIG_PATH=/etc/alsa-pulse.conf SECURITY NOTE: The root user should never have the "." in their path aliasesalias ll="/bin/ls -Al" alias mv="/bin/mv -i" # recommended for safety, there are no undo's in Linux alias cp="/bin/cp -i" # recommended for safety, there are no undo's in Linux alias rm="rm -i" # recommended for safety, there are no undo's in Linux alias mroe=more # just in case you type too fast... add others like this To unalias a command:
|
http://shop.oreilly.com/product/0636920050209.do Study Guide for LPIC-2 Certification Exams |
Wagoneers FULL SIZE JEEPS JeepMeister "Jeep is America's -Enzo Ferrari MeisterTech Diesels + |
One Page Overview Intro to Linux |
at Midway Auto on SR9 in Snohomish, or at Northland Diesel in Bellingham, WA |