how to delete folder using command linux code example Example 1: delete directory linux rm -rf dir1 Example 2: remove a folder in linux command rm -r dirnameCopy