Usage And Variation

  1. set -h Remember location of commands as they are looked up.
  2. set -n Read commands but do not execute them.

What is the SET / UNSET command?

Set is used to define/view shell and environment variables along with shell functions. When no arguement is given for the command, every environment variable is displayed in the terminal. Unset is used to delete already existing environment variables.

Examples:

Screenshot

In the example above, the user has created a variable, ar, and set its value to 4. This is a new environment variable that will be assigned a value of 4. After creating this variable, the set command is used without any arguements to display every environment and shell variable in the system. The listing is extensive, and the newly created variabe 'ar' is able to be seen if the page is scrolled with its assigned value being 4.

Try it: