how to remove directory in mac terminal code example Example 1: delete directory mac terminal rm -r dirname Example 2: sudo rmdir recursive sudo rm -r -f /path/