How to change the directory for screenshots on macOS
Open Terminal
mkdir ~/ScreenshotsThis will create a folder named "Screenshots" in your home directory.
Change the Default Location for Screenshots
defaults write com.apple.screencapture location ~/ScreenshotsApply the Changes
killall SystemUIServerIf you want to reset it back to the default location
defaults write com.apple.screencapture location ~/Desktop
killall SystemUIServer 
                    