Here are some alternatives to the rm command for safely deleting files and directories:
trash-cli: This command-line utility moves files to the trash instead of permanently deleting them. You can install it using:sudo apt install trash-cliTo delete a file, use:
trash filenamegvfs-trash: Similar totrash-cli, this command is available on systems using GNOME. You can use it like this:gvfs-trash filenamerm -i: As mentioned earlier, using the-ioption withrmprompts for confirmation before deletion:rm -i filenamefindwith-delete: This can be used to delete files found by specific criteria, but be cautious as it can also be permanent:find . -name "*.tmp" -delete
Using these alternatives can help prevent accidental data loss. If you need more information or examples, let me know!
