How to emulate Unix’ getent with MacOSX’s dscl

I've used dscl before, but since I use it at most once a year, I already forgot about it. It's time to write it down ... maybe it'll stick in my mind for longer this way. Smile
To look up a user by UID:
dscl . -search /Users UniqueID [uid number]
To read a users properties/attributes (like HOME dir, shell, etc.):
dscl . -read /Users/[username]