To remove an empty directory, use either rmdir or rm -d followed by the directory name:
rm -d dirname rmdir dirname.
To remove non-empty directories and all the files within them, use the rm command with the -r (recursive) option:
rm -r dirname.
#usage:
rmdir <dir>
#it removes <dir>
#but if it isnt empty it will not work
#so do:
rmdir /S <dir>
#--ignore-fail-on-non-empty for linux
#to remove confirmation
rmdir /Q <dir>
#it is abbreviated to rd in cmd(windows) like all commands:)
rmdir /? #for help
#the last two are windows specific
rmdir folder1 folder2 #remove empty directory folders
rm -rf folder1 folder2 #remove non-empty folders and its content recursively
rmdir <filePath>