how to delete a directory and all contents in linux code example Example: how to remove folder and its contents in linux rm -rf dirname