Problem
I would like an example bash shell which, for example, contains some aliases and tells me my current directory.
Solution
Here is an example of a $HOME/.bashrc file which achieves this.
It can be modified to suit your particular needs but serves as a good example:
----- cut here -----
set -p
if test "$UID" = 0 ; then
PS1="\h:\w # "
else
PS1="\u@\h:\w> "
fiumask 0022# # Returns short path (last two directoeries)
spwd () {
( IFS=/
set $PWD
if test $# -le 3 ; then
echo "$PWD"
else
eval echo \"..\${$(($# - 1))}/\${$#}\"
fi ) ;
}alias lfs='lf -s' # list files with size/type
alias ll='ls -l' # long listing of files (follow symlinks)
alias la='lf -a' # list all files with type
alias lfsa='lf -sa' # list all files with size/type
alias lsd='lf -d *(-/DN)' # list only directories
alias c='clear' # handy shortcut
alias d='date' # handy shortcut----- to here -----