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:
- To delete a single file:
rm file.txt
- To delete multiple files:
rm file1.txt file2.txt file3.txt
- 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.