Apple - Close all open finder windows from terminal?
Use AppleScript via osascript
:
osascript -e 'tell application "Finder" to close windows'
killall
is to kill applications, not close windows.
This one is similar but solves too, and I was able to drop even the Info windows in case they are open:
osascript -e 'tell application "Finder" to close every window'