Steps on how to remove a full directory of files in Linux from the as "rmdir: ' dir ': Directory not empty" and be unable to delete the directory. I'm trying to remember how to delete all files, subdirectories, and subdirectory contents from a specific directory from a command prompt. Linux Delete Directory Command - Explains how to remove a file and directory with the help of rm and rmdir command. You can remove files or. November 1, at 7: You can also find examples for each use case of folder deletion — euro jackpot gewonnen folders, non empty folders, folders with white spaced names. If you don't want to use the shutil module you can just use the os module. August 26, at Del dir will be faster, efficient and less memory consuming. Time commitment, benefits, and pain points. While using shutil is definitely the easiest way, there's certainly nothing unpythonic about this solution. This Batch plays pingpong between the two directories leer and leer2 and cuts away 8 'libraries' each time. Any suggestions will be welcomed. Sign up using Email and Password. July 25, at 7: Just tell it what directory you want deleted, in relation to the page that this function is executed.