How to Delete Folder in Linux?

How to Delete Folder in Linux?
Contents

How do I delete a folder in Terminal?

Type “cd directory” into the terminal window, where “directory” is the directory address holding the folder you want to delete.

Type “rm -R folder-name” where “folder-name” is the folder with the contents you want to delete permanently.

How do I force delete a directory in Linux?

To remove a directory that contains other files or directories, use the following command. In the example above, you would replace “mydir” with the name of the directory you want to delete. For example, if the directory was named files, you would type rm -r files at the prompt.

Sarah Jenkins
Author

Sarah Jenkins

Sarah Jenkins is a veteran tech journalist with over 12 years of experience covering artificial intelligence, mobile innovations, and digital ethics. Her insights have appeared in leading technology publications worldwide.