how to delte a folder in linux terminal code example Example 1: delete a directory bash script rmdir dirname Example 2: remove directory linux rm -rf /path/to/directory/*