shell remove directory and contents code example Example 1: bash remove directory rm -rf directory-name Example 2: remove folder ubuntu $ rm -r directoryName