Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've noticed that in a notebook, if I define a variable, and then delete the definition, the variable stays assigned. Is there a quick way to see all the variables that are assigned? I can find them by using the debugger, but it is kind of tedious for a quick check.

share|cite|improve this question
?Global`* works. – J. M. Dec 22 '11 at 6:52

Mathematica associates with each symbol a set of values. OwnValues is the one that stores value assignments to the symbol.

This code returns the list of symbol names (as strings) for those symbols whose OwnValues is non-empty, i.e. the symbol has been assigned a value:

 ToExpression[#, InputForm, OwnValues] =!= {} &]
share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.