how to delete a directory in mac terminal code example Example 1: delete directory mac terminal rm -r dirname Example 2: terminal delete fle rm MyFile.rtf