There is no intelligent consciousness in such ghosts. They do not interact with the living or even seem aware of anything other than their own realities. It's a bit like a short film that plays over and over as the energy of the intense experience plays itself out. Of course, sightings or visits from ghosts are very common at the time of a person's death. A woman may see her brother appear at the foot of her bed at night, and the next morning learn that he passed into spirit at exactly that time.
Ghosts are no more evil than the living, despite the horror stories and Hollywood hype.
By revealing themselves or giving signs of their presence, ghosts and spirits simply seek to communicate with us. Many people have seen or interacted with ghosts or non-physical beings without ever even being aware that this was what was happening. We often shrug off those experiences that are strange and unexplainable, even really astounding ones, because most of us just don't have a model for incorporating anomalous experiences into our belief systems. What is magical to some is seen as merely coincidental to others. For example, I've heard many stories of someone appearing in a time of great need and then vanishing into thin air when the emergency was over.