SHIFT

--- Sjoerd Hooft's InFormation Technology ---

User Tools

Site Tools


Sidebar

Recently Changed Pages:

View All Pages


View All Tags


LinkedIn




WIKI Disclaimer: As with most other things on the Internet, the content on this wiki is not supported. It was contributed by me and is published “as is”. It has worked for me, and might work for you.
Also note that any view or statement expressed anywhere on this site are strictly mine and not the opinions or views of my employer.


Pages with comments

View All Comments

aixprofile

AIX Profile

Everything on this page is usable for as well AIX 5.3 as 6.1.

Change the prompt to something useful

Change the /etc/security/.profile file:

PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:$HOME/bin:/usr/bin/X11:/sbin:.

# Set the prompt to username@hostname:/current/directory
HOST=$(hostname -s)
PS1='$USER@$HOST:$PWD>'

# Set environment for Korn Shell
ENV=$HOME/.kshrc

export PATH HOST PS1 ENV

if [ -s "$MAIL" ]           # This is at Shell startup.  In normal
then echo "$MAILMSG"        # operation, the Shell checks
fi                          # periodically.

Don't forget to copy the profile file to the home directory of existing users.

Change the terminal windows title

If you use a terminal that supports the TERM environment (like putty) setting you can also do the same to the windows title. Add, according to your preferences the correct piece of code to the .profile file:

case $TERM in
   (xterm*)
         PROMPT_COMMAND='echo -ne "\033]0;${HOST}: ${PWD}\007"'
;;
esac

Will give you:

hostname:/current/directory

And:

case $TERM in
   (xterm*)
         PROMPT_COMMAND='echo -ne "\033]0;${USER}($(id -ng))@${HOST}: ${PWD}\007"'
;;
esac

Will give you:

user(ssh-access)@hostname:/current/directory

For more information, also on adding the Oracle instance to your prompt or windows title see here at rootvg.

Set the korn shell

Create or change the /home/user/.kshrc file:

set -o vi
alias c=clear
alias dir='ls -l'
alias ll='ls -l'

Set vi

Create or change the /home/user/.exrc file:

set showmode
set number

This will automatically show the line numbers and show the mode of vi your working in, like input or replace. If you don't want to show the vi numbers issue this command inside vi:

:set nonumber

Profile possibilities

$HOME/.hushlogin

If this file exists, it will suppress the displaying of the /etc/motd file (message of the day file) and the message for unsuccessful login attempts for that user account.

set -o ignoreeof

If this line exists in your .profile <ctrl>+d won't log you out

SKEL

If you want the created profile to automatically be set for every newly created user create a directory

/etc/skel

and copy the files to that directory:

root@ms-lpar04:/etc/security>cd /etc/skel
root@ms-lpar04:/etc/skel>ls -l
-rw-r--r--    1 root     system           24 Mar  4 12:08 .exrc
-rw-r--r--    1 root     system           59 Mar  4 12:07 .kshrc
-rw-r--r--    1 root     system          416 Mar  4 12:05 .profile

Note: Don't forget to make sure everybody can read the files.

My Own Profile

PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:$HOME/bin:/usr/bin/X11:/sbin:.

# Set the prompt to username@hostname:/current/directory
HOST=$(hostname -s)
PS1='$USER@$HOST:$PWD>'

# Set environment for Korn Shell
ENV=$HOME/.kshrc

# Set terminal window
case $TERM in
   (xterm*)
         PROMPT_COMMAND='echo -ne "\033]0;${HOST}: ${PWD}\007"'
;;
esac

# Set timeout
TMOUT=3600

export PATH HOST PS1 ENV TMOUT

# Aliases
alias ll='ls -lrt'
alias c='clear'

if [ $HOST = 'backend' ] || [ $HOST = 'backend-acc' ]
   then
      alias toapp="cd /opt/comp/backend/"
      alias tolog="cd /var/log/comp"
      alias todata="cd /var/data/comp"
fi

if [ -s "$MAIL" ]           # This is at Shell startup.  In normal
then echo "$MAILMSG"        # operation, the Shell checks
fi                          # periodically.
You could leave a comment if you were logged in.
aixprofile.txt · Last modified: 2021/09/24 00:24 (external edit)