How to delete files and directories in Linux?

You can use Linux rm command to delete files and directories.

Delete a single file in Linux:

Delete a single empty directory in Linux:

Delete a single directory along with its content in Linux:

Delete multiple files or directories at once in Linux:

Delete a file or directory forcefully in Linux:

Prompt before deleting a file or directory in Linux:

Print messages while deleting a file or directory in Linux:

Leave a Reply