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