.kshrc

Here's an example of a profile that ksh runs if you set the ENV environment variable as described above for .profile:

alias rm="rm -i"
alias ll="ls -l"
export PS1='$(pwd) $ '

This profile does the following:

  • Uses an alias to turn on interactive mode for the rm command. In interactive mode, rm asks you for confirmation before it deletes the file. The cp and mv commands also support this mode.
  • Creates an alias, ll, that runs ls with the -l set. This gives a long listing that includes the size of the files, the permissions, and so on.
  • Changes the primary prompt to include the current working directory (the default if you aren't root is $). You can also change the secondary prompt by setting PS2.

    Note that you should use single quotes instead of double quotes around the string. If you specify:

    export PS1="$(pwd) $ "
      
    

    the pwd command is evaluated right away because double quotes permit command substitution; when you change directories, the prompt doesn't change.