Before I got too much farther in my learning process with the Raspberry Pi, I knew enough about Linux that there had to be a proper shutdown process so that all the files are properly closed and all running process are stopped. Since you don’t have a power switch on the Raspberry Pi, you should take every reasonable precaution to keep from having damaged or corrupted files which could force you to recreate the image you have on the SD card you are using, reinstall the services/apps that were on the card and reconfigure everything.
Here are the four different commands that I have found that will shut down the Raspberry Pi when using the Raspian distribution.
1) sudo halt -p
2) sudo shutdown -h now
3) sudo halt
4) sudo poweroff
These commands send SIGTERM signal to all running processes, notifying them to save their data and shutdown. It then sends SIGKILL signal to all remaining processes, halt the system, followed by finally unmounting all filesystems. The screen will then show Power Down and you can pull the plug.
To see more of my posts about the Raspberry Pi, please go to http://www.ronnutter.com/category/raspberry-pi/