rm: Removing Files
Deleting, carefully.
Deleting files in the terminal is easy. Too easy, some people say. Because there's one big difference from deleting with a mouse. There's no recycle bin.

- Deleting is easy
- Maybe too easy
- There's no recycle bin
Removing a file
RM, short for remove, deletes a file. RM to do dot TXT, and it's gone. Not moved to a bin. Really gone. If you try to remove a file that doesn't exist, RM tells you so.
rm todo.txt ls Documents Downloads Music Pictures notes.txt rm todo.txt rm: cannot remove 'todo.txt': No such file or directory
Asking first
Dash I makes RM ask before deleting each file. It's a good habit while you're learning. Here RM asks, remove regular file notes dot TXT? We type Y, for yes, and press Enter, and the file is deleted. Typing N, for no, would have kept it.
rm -i notes.txt rm: remove regular file 'notes.txt'? y ls Documents Downloads Music Pictures todo.txt
Safe deleting habits
A few habits will keep your files safe. Run LS first, with exactly the same name, to see what you're about to delete. Use dash I while you're learning. Keep backups of anything important. And never type a delete command you don't fully understand, even if a website tells you to.
Summary
RM deletes files for good, there's no undo, and dash I asks first. Next, deleting folders, and the one command you must be careful with.
Key takeaways- rm <file>
- No recycle bin
- rm -i asks