SHIFT

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

User Tools

Site Tools


Sidebar

Sponsor:

Would you like to sponsor this site?
Or buy me a beer?:


Recently Changed Pages:

View All Pages
View All Q Pages


View All Tags


Sign up for Q to post comments.





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.


Terms And Conditions for Q users


Pages with comments

PageDateDiscussionTags
2019/06/22 10:36 1 Comment
2019/03/15 16:02 1 Comment
2019/03/15 16:02 1 Comment
2019/03/15 16:02 3 Comments
2017/04/20 15:28 1 Comment
2017/04/20 15:23 1 Comment
2017/04/19 14:44 1 Comment
2017/04/17 20:10 1 Comment
2017/04/17 20:07 1 Comment
2017/04/17 19:58 1 Comment
2017/04/17 19:52 1 Comment

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: 2013/01/26 20:08 by sjoerd