Session and utilities
The unset command
Deletes a variable or function from the shell.
Syntax
unset NOMBREMost useful options
-vDeletes a variable-fDeletes a functionCopy-ready examples
$ export X=1 && unset XDelete a variableYou 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.
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