How to delete and remove files on Ubuntu Linux

To delete files in Ubuntu Linux, you can use the rm command in the terminal. Here are some examples of how to use the rm command:

  1. To delete a single file:
rm file.txt
  1. To delete multiple files:
rm file1.txt file2.txt file3.txt
  1. To delete a directory and all of its contents:
rm -r directory

Note: Be careful when using the rm command, as it permanently deletes the files and they cannot be recovered. If you need to delete files but retain a backup, consider using the mv command to move the files to another directory instead of deleting them.

Leave a Comment