Session and utilities

The unset command

Deletes a variable or function from the shell.

Syntax

unset NOMBRE

Most useful options

-vDeletes a variable
-fDeletes a function

Copy-ready examples

$ export X=1 && unset XDelete a variable

You can try them in the browser terminal: it does not touch your computer.

Typical mistakes

  • If the variable was important, the command using it will stop working.

Related commands

FAQ

Does it delete the config file too?

No: only the variable in the current session.

Learn to actually use it

The basic Linux course takes you from zero to console fluency with 24 self-grading lessons.

Start the free course