how to remove directory from bash code example Example 1: bash remove directory rm -rf directory-name Example 2: delete a directory bash script rmdir dirname