Useful tips for profile

less than 1 minute read

If you are familiar with unix or linux, you know how important profile settings are. If I were to build a new server environment, I would check the profile first. The following settings are the ones I set up mainly in ksh or bash environments.

.bash_profile

stty erase "^H" kill "^U" intr "^C" eof "^D"
stty hupcl ixon ixoff
stty cs8 -istrip

##########################################################
# export
##########################################################
export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/vac/bin:/usr/ccs/bin/
export PATH=$PATH:.

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi

set -o vi
export EDITOR=vi

# prompt
export PS1='^[[1;32m[`hostname`:`whoami`][`pwd`] # ^[[0m'

##########################################################
# enable color support of ls and also add handy aliases
##########################################################
if [ -x /usr/bin/dircolors ]; then
    test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
    alias ls='ls --color=auto'
    #alias dir='dir --color=auto'
    #alias vdir='vdir --color=auto'

    alias grep='grep --color=auto'
    alias fgrep='fgrep --color=auto'
    alias egrep='egrep --color=auto'
fi

##########################################################
# alias
##########################################################
alias ll='ls -alF'
alias la='ls -A'

Tags:

Categories:

Updated:

Leave a comment