z/OS UNIX System Services User's Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Using alias tracking

z/OS UNIX System Services User's Guide
SA23-2279-00

Alias tracking can reduce the time the shell spends searching your search path (specified with the PATH variable) for a command; it helps shell scripts run faster. A tracked alias is a shell-created alias that is the full pathname for a command. The shell automatically tracks everything it finds in the default path for executables (/bin). For example, if you enter the ps command, the shell creates the alias:
ps="/bin/ps"
To use alias tracking for commands in other locations, enter the command:
set -o trackall
The first time you enter a command, the shell creates an alias that is the full pathname of the command. For example, if the user marcw entered the hello command and the shell tracked the command, it would create the alias:
hello="/u/marcw/bin"
Each time you enter a command, the shell uses its tracked alias, instead of searching the PATH for the command.
To list your tracked aliases, enter the command:
alias -t
To turn off alias tracking of all commands, enter the command:
set +o trackall
Then commands found in directories other than /bin are not tracked. When the PATH search finds a command in /bin, the pathname will always be tracked.
To remove tracked aliases, use:
alias -r

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014