Shutdown without and close all windows from terminal If I shutdown/reboot from Menu I get an option of saving state of open windows or not, but if I issue a command from terminal say shutdown -h now it will shutdown remembering all open windows, how can I shutdown without remembering any of the open windows just like the Menu option from terminal ?
I am searching for a solution to the same problem. I have not found a nice solution although there is a hacky one here which in short is:

Disable saving application state:

rm -r '~/Library/Saved Application State/*'
chmod -R a-w '~/Library/Saved Application State'


Disable 'Reopen windows when logging back in':

defaults write com.apple.loginwindow TALLogoutSavesState -bool false
chmod a-w ~/Library/Preferences/com.apple.loginwindow.plist
sudo chown root ~/Library/Preferences/com.apple.loginwindow.plist


See the provided link for more details.

But I really hope there is some better solution to this ? In my case the problem is that I have a mac in a server room that automatically runs a script in a terminal window. This machine can be rebooted remotely. But thus every time it reboots it keeps the old terminal window and opens a new one, so if I have rebooted it 10 times there will be 10 terminal windows open where only one is in use.