= AIX Profile **Summary**: ALthough AIX is by now on version 7.3 I find these old pages so fascinating I decided to keep them. On this page I'll show you how to configure your profile on an AIX server. This page is for AIX 5.3 and AIX 6.1.\\ **Date**: Between 2010-2013 \\ **Refactor**: 21 December 2024: Checked formatting. \\ {{tag>aix}} == 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 [[http://www.rootvg.net/content/view/186/89/|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 +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.