Sunday, September 7, 2008

commonly used SHELL variables

BASH Shows path name of the bash command (/bin/bash).


BASH_VERSION The version number of the bash command.


CDPATH search path for the CD command


COLUMNS The width of the terminal line (in characters).




DISPLAY Identifies the X display where commands launched from the
current shell will be displayed (such as :0.0).


EUID Effective user ID number of the current user. usually the same as UID but can be
different when the user changes IDs, as with su command, which allows a user to
become an effective root userIt is based on the user entry in
/etc/passwd for the user

EXINIT initialization commands for the Ex/vi editor




GROUPS Lists groups of which the current user is a member.

HISTCMD Shows the current command’s history number.


HISTFILE Shows the location of your history file (usually located at $HOME/.bash_history).



HISTFILESIZE Total number of history entries that will be stored (default, 1000).
Older commands are discarded after this number is reached.


HISTCMD The number of the current command in the history list.


HOME Location of the current user’s home directory.
Typing the cd command with no options returns the shell to the home directory.


HOSTNAME The current machine’s host name.


HOSTTYPE Contains the computer architecture on which the Linux system is
running (i386, i486, i586, i686, x86_64, ppc, or ppc64).


LESSOPEN Set to a command that converts content other than plain text
(images, RPMs, zip files, and so on) so it can be piped through the
less command.

LINES Sets the number of lines in the current terminal


LOGNAME Holds the name of the current user.


LS_COLORS Maps colors to file extensions to indicate the colors the ls command
displays when encountering those file types.


MACHTYPE Displays information about the machine architecture, company, and
operating system (such as i686-redhat-linux-gnu)


MAILCHECK Checks for mail in the number of seconds specified (default is 60).


OLDPWD Directory that was the working directory before changing to the
current working directory.

OSTYPE Name identifying the current operating system (such as linux or linux-gnu)


PATH Colon-separated list of directories used to locate commands that you
type (/bin, /usr/bin, and $HOME/bin are usually in the PATH).

PPID Process ID of the command that started the current shell.


PWD The directory assigned as your current directory.

PS1 Primary shell prompt

PS2 secondary shell prompt


RANDOM Accessing this variable generates a random number between 0 and 32767.

SECONDS The number of seconds since the shell was started.

SHELL Contains the full path to the current shell.

SHELLOPTS Lists enabled shell options (those set to on)

SHLVL current shell level, number of shells invoked.

TERM terminal type

USER username

UID user ID of the current user

No comments:

Post a Comment