Managing User Accounts and User Environments in Oracle® Solaris 11.2

Exit Print View

Updated: September 2014
 
 

Shell Features

    This Oracle Solaris release supports the following shell features and behavior:

  • The user account that is created when you install the Oracle Solaris release is assigned the GNU Bourne-Again Shell (bash) by default.

  • The standard system shell (bin/sh) is now the Korn Shell 93 (ksh93).

  • The default interactive shell is the Bourne-again (bash) shell (/usr/bin/bash).

  • Both the bash and ksh93 shells feature command-line editing, which means you can edit commands before executing them.

  • You can display default shell and path information in a few different ways:

    • Use the echo $SHELL and which commands:

      $ grep root /etc/passwd
      root:x:0:0:Super-User:/root:/usr/bin/bash 
      
      $ echo $SHELL
      /usr/bin/bash
      
      $ which ksh93
      /usr/bin/ksh93
    • Use the pargs command:

      ~$ pargs -l $$
      /usr/bin/i86/ksh93
  • The ksh93 shell also has a built-in variable called .sh.version, which can be displayed as follows:

    ~$ echo ${.sh.version}
    Version jM 93u 2011-02-08
  • To change to a different shell, type the path of the shell that you want to use.

  • To exit a shell, type exit.

The following table describes the shell options that are supported in Oracle Solaris.

Table 1-8  Basic Shell Features in the Oracle Solaris Release
Shell
Path
Comments
Bourne-Again Shell (bash)
/usr/bin/bash
Default shell for users that are created by an installer, as well as the root role
The default (interactive) shell for users that are created with the useradd command as well as the root role is /usr/bin/bash. The default path is /usr/bin:/usr/sbin.
Korn Shell
/usr/bin/ksh
ksh93 is the default shell in this Oracle Solaris release
C Shell and enhanced C Shell
/usr/bin/csh and /usr/bin/tcsh
C Shell and enhanced C Shell
POSIX-compliant Shell
/usr/xpg4/bin/sh
POSIX-compliant shell
Z Shell
/usr/bin/zsh
Z Shell

Note -  The Z Shell (zsh) and the enhanced C Shell (tsch) are not installed on your system by default. To use either of these shells, you must first install the required software packages.

The following table shows the default UNIX® system prompt and superuser prompt for shells that are included in the Oracle Solaris OS. Note that the default system prompt that is displayed in command examples varies, depending on the Oracle Solaris release.

Table 1-9  Shell Prompts
Shell
Prompt
Bash shell, Korn shell, and Bourne shell
$
Bash shell, Korn shell, and Bourne shell for superuser
#
C shell
machine_name%
C shell for superuser
machine_name#