Suddenly unable to screenshot- Do not have permission to save files in the location where screenshots are stored
You may have just gotten the commands wrong. Try

defaults write com.apple.screencapture location /Users/eggsalad/Desktop


make sure to press Return, then 

killall SystemUIServer


and press Return again.

Then run

defaults read com.apple.screencapture location


As a last resort, just reset all the settings for your user:

 defaults delete com.apple.screencapture