How to broadcast message to all logged in users through Terminal?

Use the wall command, it can be used as so:

echo "message" | wall

This will broadcast the message in Terminal to all logged in users through Terminal.