な is classified as a 終助詞(しゅうじょし), or ‘sentence ending particle’ in Japanese. It may also be said as
なあ. When attached to the base (dictionary) form of a verb, it has the nuance of strongly demanding that someone ‘not’ do something.
The
な used with verbs is the same
な that is often used in sentences describing things that you want, or think are good (for yourself).
In this way,
な can be thought of as the opposite of the sentence ending particle
ね.
ね highlights that you are expressing a mutual thought, or something that can be shared between the speaker and the listener.
な, on the other hand, shows that something is for the speaker only, or only the speaker has intimate knowledge of it. This is why it comes across as ‘don’t’ (when used after a verb), as you are literally saying ‘this (verb) is not for you!’