The sudo rm -rf /Library/Developer/CommandLineTools command deletes the entire Library/Developer folder and all of its contents. The xcode-select --install command installs the latest version of the Xcode development environment.
sudo rm -rf /Library/Developer/CommandLineTools && xcode-select --install